unlock ConnectionPool on failure

This commit is contained in:
Tomáš Chaloupka 2019-07-31 14:41:26 +02:00
parent 382a8d8a11
commit 4e8302d10d

View file

@ -74,6 +74,8 @@ final class ConnectionPool(Connection)
debug assert(m_thread is () @trusted { return Thread.getThis(); } (), "ConnectionPool was called from a foreign thread!"); debug assert(m_thread is () @trusted { return Thread.getThis(); } (), "ConnectionPool was called from a foreign thread!");
() @trusted { m_sem.lock(); } (); () @trusted { m_sem.lock(); } ();
scope (failure) () @trusted { m_sem.unlock(); } ();
size_t cidx = size_t.max; size_t cidx = size_t.max;
foreach( i, c; m_connections ){ foreach( i, c; m_connections ){
auto plc = c in m_lockCount; auto plc = c in m_lockCount;