futex2#313
Conversation
|
I've fixed CI on master, do you mind rebasing? |
just a reminder in case you missed it. I rebased my branch on master and CI is now green |
| Realtime(Duration), | ||
| } | ||
|
|
||
| impl Deadline { |
There was a problem hiding this comment.
I think a good follow up PR would be to use Deadline in more places for more support for sleeping on realtime clock
| /// wait in both directions across a step. | ||
| pub async fn sleep(self) { | ||
| loop { | ||
| let now = self.clock_now(); |
There was a problem hiding this comment.
Deadline::sleep() reads date()before clock_set_generation(). If there is a settime in that window, the wait computes remaining from the old wall clock, then subscribes starting at the new generation, so it misses the step that should retarget the timeout.
| } | ||
|
|
||
| if !registered { | ||
| waiters.register(cx.waker()); |
There was a problem hiding this comment.
The token is thrown here. If a wrapping select! exits via timer/interrupt, the registration stays in the waiter set until the next realtime clock change.
| nr_wake: i32, | ||
| nr_requeue: i32, | ||
| ) -> Result<usize> { | ||
| // No syscall-level flags are defined. |
There was a problem hiding this comment.
Linux implements futex2 requeue differently: (kernel/futex/syscalls.c, SYSCALL_DEFINE4(futex_requeue)). Userspace can observe a successful requeue where it should get EAGAIN or EINVAL.
No description provided.