CHANGE LOCK TO NOT BE DROPPED INSTANTLY. DANG U RUST

co-authored-by: kay@zed.dev
This commit is contained in:
Mikayla Maki 2022-12-02 12:43:02 -08:00
parent 5e240f98f0
commit 5262e8c77e
6 changed files with 39 additions and 29 deletions

View file

@ -13,4 +13,4 @@ smol = "1.2"
thread_local = "1.1.4"
lazy_static = "1.4"
parking_lot = "0.11.1"
futures = "0.3"
futures = "0.3"

View file

@ -266,12 +266,10 @@ pub fn background_thread_queue() -> WriteQueueConstructor {
pub fn locking_queue() -> WriteQueueConstructor {
Box::new(|| {
let mutex = Mutex::new(());
let write_mutex = Mutex::new(());
Box::new(move |queued_write| {
eprintln!("Write started");
let _ = mutex.lock();
let _lock = write_mutex.lock();
queued_write();
eprintln!("Write finished");
})
})
}