CHANGE LOCK TO NOT BE DROPPED INSTANTLY. DANG U RUST
co-authored-by: kay@zed.dev
This commit is contained in:
parent
5e240f98f0
commit
5262e8c77e
6 changed files with 39 additions and 29 deletions
|
@ -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"
|
||||
|
|
|
@ -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");
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue