mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-10 21:18:36 +00:00
Use parking_lot::const_recursive_mutex instead of lazy_static
This commit is contained in:
parent
54ab45b15c
commit
c768fc49a4
@ -19,7 +19,6 @@ bitflags = "1.0"
|
||||
glium = { version = "0.28", default-features = false, optional = true }
|
||||
gfx = { version = "0.18", optional = true }
|
||||
imgui-sys = { version = "0.6.0", path = "imgui-sys" }
|
||||
lazy_static = "1.1"
|
||||
parking_lot = "0.11"
|
||||
|
||||
[features]
|
||||
|
||||
1
imgui-examples/Cargo.lock
generated
1
imgui-examples/Cargo.lock
generated
@ -615,7 +615,6 @@ dependencies = [
|
||||
"bitflags",
|
||||
"glium",
|
||||
"imgui-sys",
|
||||
"lazy_static",
|
||||
"parking_lot",
|
||||
]
|
||||
|
||||
|
||||
@ -59,11 +59,9 @@ pub struct Context {
|
||||
clipboard_ctx: Option<Box<ClipboardContext>>,
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
// This mutex needs to be used to guard all public functions that can affect the underlying
|
||||
// Dear ImGui active context
|
||||
static ref CTX_MUTEX: ReentrantMutex<()> = ReentrantMutex::new(());
|
||||
}
|
||||
// This mutex needs to be used to guard all public functions that can affect the underlying
|
||||
// Dear ImGui active context
|
||||
static CTX_MUTEX: ReentrantMutex<()> = parking_lot::const_reentrant_mutex(());
|
||||
|
||||
fn clear_current_context() {
|
||||
unsafe {
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
pub extern crate imgui_sys as sys;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
use std::cell;
|
||||
use std::ffi::CStr;
|
||||
|
||||
@ -3,9 +3,7 @@ use std::ptr;
|
||||
|
||||
use crate::context::Context;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref TEST_MUTEX: ReentrantMutex<()> = ReentrantMutex::new(());
|
||||
}
|
||||
pub static TEST_MUTEX: ReentrantMutex<()> = parking_lot::const_reentrant_mutex(());
|
||||
|
||||
pub fn test_ctx() -> (ReentrantMutexGuard<'static, ()>, Context) {
|
||||
let guard = TEST_MUTEX.lock();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user