diff options
Diffstat (limited to 'generic/threadshare/src/runtime/executor.rs')
-rw-r--r-- | generic/threadshare/src/runtime/executor.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/generic/threadshare/src/runtime/executor.rs b/generic/threadshare/src/runtime/executor.rs index b8c2e01f6..fe3552904 100644 --- a/generic/threadshare/src/runtime/executor.rs +++ b/generic/threadshare/src/runtime/executor.rs @@ -40,7 +40,7 @@ use futures::prelude::*; use gst::{gst_debug, gst_log, gst_trace, gst_warning}; -use lazy_static::lazy_static; +use once_cell::sync::Lazy; use std::cell::RefCell; use std::collections::{HashMap, VecDeque}; @@ -66,9 +66,8 @@ use super::RUNTIME_CAT; // // Also, we want to be able to `acquire` a `Context` outside of an `async` context. // These `Mutex`es must be `lock`ed for a short period. -lazy_static! { - static ref CONTEXTS: Mutex<HashMap<String, Weak<ContextInner>>> = Mutex::new(HashMap::new()); -} +static CONTEXTS: Lazy<Mutex<HashMap<String, Weak<ContextInner>>>> = + Lazy::new(|| Mutex::new(HashMap::new())); thread_local!(static CURRENT_THREAD_CONTEXT: RefCell<Option<ContextWeak>> = RefCell::new(None)); |