MCPcopy Create free account
hub / github.com/defold/defold / Reopen

Function Reopen

engine/dlib/src/dlib/connection_pool.cpp:657–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655 }
656
657 void Reopen(HPool pool)
658 {
659 // This function is used by tests to restore usage of a pool
660 // We purge idle pooled connections so the test does not run out
661 // of connection pool items. In-use slots keep their handles until
662 // their owners unwind, otherwise a concurrent request can observe an
663 // invalidated connection handle during shutdown.
664 DM_MUTEX_SCOPED_LOCK(pool->m_Mutex);
665 uint32_t n = pool->m_Connections.Size();
666 for (uint32_t i=0; i != n; i++) {
667 Connection* c = &pool->m_Connections[i];
668 if (c->m_State == STATE_CONNECTED) {
669 DoClose(pool, c);
670 }
671 }
672 pool->m_AllowNewConnections = 1;
673 }
674}

Callers 1

ReopenConnectionPoolFunction · 0.85

Calls 2

DoCloseFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected