Add comment about futex_wait timeout.
This commit is contained in:
parent
c9ae3fe68f
commit
c49887da27
1 changed files with 2 additions and 0 deletions
|
@ -14,6 +14,8 @@ pub fn futex_wait(futex: &AtomicI32, expected: i32, timeout: Option<Duration>) -
|
|||
use crate::sync::atomic::Ordering::Relaxed;
|
||||
|
||||
// Calculate the timeout as an absolute timespec.
|
||||
//
|
||||
// Overflows are rounded up to an infinite timeout (None).
|
||||
let timespec =
|
||||
timeout.and_then(|d| Some(Timespec::now(libc::CLOCK_MONOTONIC).checked_add_duration(&d)?));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue