add register fd and fix bug in mutex
continuous-integration/drone/push Build is passing

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
juju committed 2022-12-23 01:08:00 +01:00
1 parent d66fb31c9a
commit e5eb05eb3d
7 files changed
+23 -6

No files matched your search

+3 -3
View File
@@ -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,
}
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.