mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
ef743e235b
commit
be5688aed9
1 changed files with 2 additions and 1 deletions
|
|
@ -16,11 +16,12 @@ impl<T> LastValue<T> {
|
||||||
|
|
||||||
pub async fn get(&self) -> T {
|
pub async fn get(&self) -> T {
|
||||||
loop {
|
loop {
|
||||||
|
let notified = self.inner.0.notified();
|
||||||
if let Some(data) = self.inner.1.lock().take() {
|
if let Some(data) = self.inner.1.lock().take() {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.inner.0.notified().await;
|
notified.await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue