We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f45eee8 commit 3e5912cCopy full SHA for 3e5912c
rayon-core/src/thread_pool/mod.rs
@@ -277,6 +277,13 @@ impl ThreadPool {
277
// We assert that `self.registry` has not terminated.
278
unsafe { spawn::spawn_fifo_in(op, &self.registry) }
279
}
280
+
281
+ /// Terminates the threads, renders the threadpool unusable.
282
+ /// This is useful for testing (miri) if the thread-pool is static.
283
+ /// It should be used upon shutdown only
284
+ pub unsafe fn terminate(&self) {
285
+ self.registry.terminate();
286
+ }
287
288
289
impl Drop for ThreadPool {
0 commit comments