verify that IOThreadPools get shut down (#635)
Motivation: Not shutting down IOThreadPools leads to thread leaks so we should verify they're actually shut down. Modifications: add a check that we're shutting down Result: fewer thread leaks
This commit is contained in:
parent
176dd6e856
commit
6e6c68c1b2
|
@ -169,6 +169,15 @@ public final class BlockingIOThreadPool {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
deinit {
|
||||
switch self.state {
|
||||
case .stopped, .shuttingDown:
|
||||
()
|
||||
default:
|
||||
assertionFailure("wrong state \(self.state)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public extension BlockingIOThreadPool {
|
||||
|
|
Loading…
Reference in New Issue