0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Update connection_pool.h (#363)

This commit is contained in:
byronhe 2021-04-24 19:17:01 +08:00 committed by GitHub
parent 9203e3818f
commit 739b3db69c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,6 +172,7 @@ namespace sqlpp
connection_pool& operator=(connection_pool&&) = delete; connection_pool& operator=(connection_pool&&) = delete;
pool_connection<Connection_config, Reconnect_policy, Connection> get_connection() pool_connection<Connection_config, Reconnect_policy, Connection> get_connection()
{
{ {
std::lock_guard<std::mutex> lock(connection_pool_mutex); std::lock_guard<std::mutex> lock(connection_pool_mutex);
if (!free_connections.empty()) if (!free_connections.empty())
@ -180,6 +181,7 @@ namespace sqlpp
free_connections.pop(); free_connections.pop();
return pool_connection<Connection_config, Reconnect_policy, Connection>(connection, this); return pool_connection<Connection_config, Reconnect_policy, Connection>(connection, this);
} }
}
try try
{ {