You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In current implementation of wait_queue, wait_timeout_until function supports blocking the current task and put it into the wait queue, until the given condition becomes true, or the given duration has elapsed.
This function is awkward because a AxTaskRef may co-exist in both wait queue and timer list, which brings complexity in cancel_events.
Question
When I try to port Condvar from rust std library, in function wait_timeout_while, I found it difficult to reuse the wait_timeout_until from wait queue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Background
In current implementation of wait_queue,
wait_timeout_until
function supports blocking the current task and put it into the wait queue, until the givencondition
becomes true, or the given duration has elapsed.This function is awkward because a
AxTaskRef
may co-exist in both wait queue and timer list, which brings complexity incancel_events
.Question
When I try to port
Condvar
from rust std library, in functionwait_timeout_while
, I found it difficult to reuse thewait_timeout_until
from wait queue.It only needs to rely on
wait_timeout
, if we do want to reusewait_timeout_until
, we still need to mind the dropping and re-acquiring ofMutexGuard
.Beta Was this translation helpful? Give feedback.
All reactions