Remove a few unnecessary usages of Lazy (#3531)
* Convert usage of Lazy to OnceLock on macOS and iOS * Remove a few uses of Lazy that wrapped Mutex or RwLock The `new` functions on these were made `const` in Rust 1.63.0 * Use AtomicBool instead of RwLock
This commit is contained in:
parent
a5dbd3ee52
commit
c4e6e94b80
6 changed files with 51 additions and 52 deletions
|
|
@ -8,10 +8,9 @@ use std::{
|
|||
};
|
||||
|
||||
use super::{super::atoms::*, ffi, util, XConnection, XError};
|
||||
use crate::utils::Lazy;
|
||||
use x11rb::protocol::xproto;
|
||||
|
||||
static GLOBAL_LOCK: Lazy<Mutex<()>> = Lazy::new(Default::default);
|
||||
static GLOBAL_LOCK: Mutex<()> = Mutex::new(());
|
||||
|
||||
unsafe fn open_im(xconn: &Arc<XConnection>, locale_modifiers: &CStr) -> Option<ffi::XIM> {
|
||||
let _lock = GLOBAL_LOCK.lock();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue