pub fn deinit(pool: *ConnectionPool, io: Io) void pool: *ConnectionPoolio: Io182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200 pub fn deinit(pool: *ConnectionPool, io: Io) void {
pool.mutex.lockUncancelable(io);
var next = pool.free.first;
while (next) |node| {
const connection: *Connection = @alignCast(@fieldParentPtr("pool_node", node));
next = node.next;
connection.destroy(io);
}
next = pool.used.first;
while (next) |node| {
const connection: *Connection = @alignCast(@fieldParentPtr("pool_node", node));
next = node.next;
connection.destroy(io);
}
pool.* = undefined;
}
Frees the connection pool and closes all connections within.
All future operations on the connection pool will deadlock.
Threadsafe.