Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
1 parent
d66fb31c9a
commit
e5eb05eb3d
7 files changed
+23
-6
No files matched your search
+3
-3
@@ -48,18 +48,18 @@ impl Future for Lock {
|
||||
type Output = ();
|
||||
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
|
||||
if self.try_lock() {
|
||||
if !self.try_lock() {
|
||||
return Poll::Ready(());
|
||||
}
|
||||
|
||||
self.waker.register(&cx.waker());
|
||||
|
||||
match self.try_lock() {
|
||||
true => {
|
||||
false => {
|
||||
self.waker.take();
|
||||
Poll::Ready(())
|
||||
},
|
||||
false => Poll::Pending,
|
||||
true => Poll::Pending,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||