Author: wyoung
Date: Thu Jul 12 04:18:10 2007
New Revision: 1671
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1671&view=rev
Log:
Added ConnectionPool::release()
Modified:
trunk/lib/cpool.cpp
trunk/lib/cpool.h
Modified: trunk/lib/cpool.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/cpool.cpp?rev=1671&r1=1670&r2=1671&view=diff
==============================================================================
--- trunk/lib/cpool.cpp (original)
+++ trunk/lib/cpool.cpp Thu Jul 12 04:18:10 2007
@@ -82,5 +82,23 @@
}
}
+
+//// release ///////////////////////////////////////////////////////////
+
+void
+ConnectionPool::release(const Connection* pc)
+{
+ lock();
+
+ for (PoolIt it = pool_.begin(); it != pool_.end(); ++it) {
+ if (it->conn == pc) {
+ it->in_use = false;
+ break;
+ }
+ }
+
+ unlock();
+}
+
} // end namespace mysqlpp
Modified: trunk/lib/cpool.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/cpool.h?rev=1671&r1=1670&r2=1671&view=diff
==============================================================================
--- trunk/lib/cpool.h (original)
+++ trunk/lib/cpool.h Thu Jul 12 04:18:10 2007
@@ -77,6 +77,12 @@
/// \retval a pointer to the most recently used connection
Connection* connection();
+ /// \brief Mark the given connection as no longer in use.
+ ///
+ /// If you don't call this function, connections returned by
+ /// connection() will never go away!
+ void release(const Connection* pc);
+
protected:
//// Subclass overrides
/// \brief Create a new connection
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits