| 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 | } |
no test coverage detected