summaryrefslogtreecommitdiff
path: root/odb/mysql/connection-factory.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-15 16:27:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-15 16:27:03 +0200
commit842e37f7372fbfaf7cc5aa422e5c20a28f5d5d61 (patch)
tree7b83d57a4a585458bfa9c9afebb01d0ff44797f4 /odb/mysql/connection-factory.cxx
parent32d0e84aa093f8dfcb64ba111cc5f6640fd3869d (diff)
Change shared_ptr callback interface to work in mt-environment
Diffstat (limited to 'odb/mysql/connection-factory.cxx')
-rw-r--r--odb/mysql/connection-factory.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/odb/mysql/connection-factory.cxx b/odb/mysql/connection-factory.cxx
index 2d86b82..bef21ce 100644
--- a/odb/mysql/connection-factory.cxx
+++ b/odb/mysql/connection-factory.cxx
@@ -226,7 +226,7 @@ namespace odb
}
}
- void connection_pool_factory::
+ bool connection_pool_factory::
release (pooled_connection* c)
{
c->clear ();
@@ -249,6 +249,8 @@ namespace odb
if (waiters_ != 0)
cond_.signal ();
+
+ return !keep;
}
//
@@ -264,13 +266,11 @@ namespace odb
shared_base::callback_ = &callback_;
}
- void connection_pool_factory::pooled_connection::
+ bool connection_pool_factory::pooled_connection::
zero_counter (void* arg)
{
pooled_connection* c (static_cast<pooled_connection*> (arg));
-
- if (c->pool_)
- c->pool_->release (c);
+ return c->pool_ ? c->pool_->release (c) : true;
}
}
}