Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-11-22 17:24:55 +0300
committerSebastian Dröge <sebastian@centricular.com>2020-11-23 11:28:33 +0300
commit1c9c22df0c6a6aeb7071f52efbba03d8f1d9a2cd (patch)
treeec5781a5940259a9f443fa5d12424b54a9cea220 /generic/threadshare/src/runtime
parent684f52b7d4b262079d819bf61ddc287ae325151c (diff)
generic: Update to 2018 edition
Diffstat (limited to 'generic/threadshare/src/runtime')
-rw-r--r--generic/threadshare/src/runtime/executor.rs7
-rw-r--r--generic/threadshare/src/runtime/mod.rs10
2 files changed, 8 insertions, 9 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));
diff --git a/generic/threadshare/src/runtime/mod.rs b/generic/threadshare/src/runtime/mod.rs
index 80f01d8d2..d22fe802c 100644
--- a/generic/threadshare/src/runtime/mod.rs
+++ b/generic/threadshare/src/runtime/mod.rs
@@ -59,12 +59,12 @@ pub mod prelude {
pub mod time;
-use lazy_static::lazy_static;
+use once_cell::sync::Lazy;
-lazy_static! {
- static ref RUNTIME_CAT: gst::DebugCategory = gst::DebugCategory::new(
+static RUNTIME_CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
+ gst::DebugCategory::new(
"ts-runtime",
gst::DebugColorFlags::empty(),
Some("Thread-sharing Runtime"),
- );
-}
+ )
+});