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.
global_registry()
THE_REGISTRY_SET
1 parent 6410e79 commit 58e109aCopy full SHA for 58e109a
rayon-core/src/registry.rs
@@ -103,12 +103,9 @@ static THE_REGISTRY_SET: Once = ONCE_INIT;
103
/// initialization has not already occurred, use the default
104
/// configuration.
105
fn global_registry() -> &'static Arc<Registry> {
106
- unsafe {
107
- THE_REGISTRY.unwrap_or_else(|| {
108
- init_global_registry(ThreadPoolBuilder::new())
109
- .expect("The global thread pool has not been initialized.")
110
- })
111
- }
+ set_global_registry(|| Registry::new(ThreadPoolBuilder::new()))
+ .or_else(|err| unsafe { THE_REGISTRY.ok_or(err) })
+ .expect("The global thread pool has not been initialized.")
112
}
113
114
/// Starts the worker threads (if that has not already happened) with
0 commit comments