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:
Johannes Weiss 2018-10-29 09:51:31 -07:00 committed by Cory Benfield
parent 176dd6e856
commit 6e6c68c1b2
1 changed files with 9 additions and 0 deletions

View File

@ -169,6 +169,15 @@ public final class BlockingIOThreadPool {
}
}
}
deinit {
switch self.state {
case .stopped, .shuttingDown:
()
default:
assertionFailure("wrong state \(self.state)")
}
}
}
public extension BlockingIOThreadPool {