unlock ConnectionPool on failure
This commit is contained in:
parent
382a8d8a11
commit
4e8302d10d
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue