diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-11-22 17:24:55 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2020-11-23 11:28:33 +0300 |
commit | 1c9c22df0c6a6aeb7071f52efbba03d8f1d9a2cd (patch) | |
tree | ec5781a5940259a9f443fa5d12424b54a9cea220 /generic/threadshare/src/runtime/executor.rs | |
parent | 684f52b7d4b262079d819bf61ddc287ae325151c (diff) |
generic: Update to 2018 edition
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)); |