mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 21:48:36 +00:00
16 lines
399 B
Rust
16 lines
399 B
Rust
use parking_lot::{ReentrantMutex, ReentrantMutexGuard};
|
|
use std::ptr;
|
|
|
|
use crate::context::Context;
|
|
|
|
lazy_static! {
|
|
pub static ref TEST_MUTEX: ReentrantMutex<()> = ReentrantMutex::new(());
|
|
}
|
|
|
|
pub fn test_ctx() -> (ReentrantMutexGuard<'static, ()>, Context) {
|
|
let guard = TEST_MUTEX.lock();
|
|
let mut ctx = Context::create();
|
|
ctx.io_mut().ini_filename = ptr::null();
|
|
(guard, ctx)
|
|
}
|