Skip to content

Commit c49887d

Browse files
committed
Add comment about futex_wait timeout.
1 parent c9ae3fe commit c49887d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/std/src/sys/unix/futex.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ pub fn futex_wait(futex: &AtomicI32, expected: i32, timeout: Option<Duration>) -
1414
use crate::sync::atomic::Ordering::Relaxed;
1515

1616
// Calculate the timeout as an absolute timespec.
17+
//
18+
// Overflows are rounded up to an infinite timeout (None).
1719
let timespec =
1820
timeout.and_then(|d| Some(Timespec::now(libc::CLOCK_MONOTONIC).checked_add_duration(&d)?));
1921

0 commit comments

Comments
 (0)