Commit 322ba68
committed
POSIX: Keep original timeout from sleep call
The `dispatch_sema4_timedwait` would reset the `_timeout` to an absolute
time after the sleep was interrupted instead of when the sleep was
called. Interrupting the process while it was sleeping would result in
the new absolute timeout deadline being computed using the `timeout`
offset from the time of the interrupt. e.g. if the timeout is 10
seconds, it will be ten seconds from when the process was interrupted
because the absolute deadline was recomputed. Interrupting the process
repeatedly while sleeping would will make the process go back to sleep
instead of waking up when the original absolute deadline was reached.
`timeout` is a relative timeout offset. `nsec` and `_timeout` are
absolute times since the epoch specifying when the wait should stop.1 parent 4029973 commit 322ba68
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
234 | 237 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
0 commit comments