mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-18 03:56:42 +00:00
Unregister observer when timeout is reached
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
6e612fc730
commit
5cde55da3d
@ -153,14 +153,14 @@ impl Pauser {
|
|||||||
let res = if let Some(timeout) = timeout {
|
let res = if let Some(timeout) = timeout {
|
||||||
self.wait_queue
|
self.wait_queue
|
||||||
.wait_until_or_timeout(cond, timeout)
|
.wait_until_or_timeout(cond, timeout)
|
||||||
.ok_or_else(|| Error::with_message(Errno::ETIME, "timeout is reached"))?
|
.ok_or_else(|| Error::with_message(Errno::ETIME, "timeout is reached"))
|
||||||
} else {
|
} else {
|
||||||
self.wait_queue.wait_until(cond)
|
Ok(self.wait_queue.wait_until(cond))
|
||||||
};
|
};
|
||||||
|
|
||||||
posix_thread.unregiser_sigqueue_observer(&observer);
|
posix_thread.unregiser_sigqueue_observer(&observer);
|
||||||
|
|
||||||
match res {
|
match res? {
|
||||||
Res::Ok(r) => Ok(r),
|
Res::Ok(r) => Ok(r),
|
||||||
Res::Interrupted => return_errno_with_message!(Errno::EINTR, "interrupted by signal"),
|
Res::Interrupted => return_errno_with_message!(Errno::EINTR, "interrupted by signal"),
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user