Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions rayon-core/src/thread_pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ impl ThreadPool {
// We assert that `self.registry` has not terminated.
unsafe { spawn::spawn_fifo_in(op, &self.registry) }
}

/// Terminates the threads, renders the threadpool unusable.
/// This is useful for testing (miri) if the thread-pool is static.
/// It should be used upon shutdown only
pub unsafe fn terminate(&self) {
self.registry.terminate();
}
}

impl Drop for ThreadPool {
Expand Down