about summary refs log tree commit diff
path: root/library/std/src/sys/unix/futex.rs
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2022-04-01 11:10:58 +0200
committerMara Bos <m-ou.se@m-ou.se>2022-04-01 11:10:58 +0200
commitc49887da277334226d17f7633392425e808b46d7 (patch)
tree94b25df6d009b5b76e0469284c1b41374afa0ceb /library/std/src/sys/unix/futex.rs
parentc9ae3fe68fc4477350476acb649b817a80bfd973 (diff)
downloadrust-c49887da277334226d17f7633392425e808b46d7.tar.gz
rust-c49887da277334226d17f7633392425e808b46d7.zip
Add comment about futex_wait timeout.
Diffstat (limited to 'library/std/src/sys/unix/futex.rs')
-rw-r--r--library/std/src/sys/unix/futex.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/futex.rs b/library/std/src/sys/unix/futex.rs
index b82a4a73440..c61d948fb60 100644
--- a/library/std/src/sys/unix/futex.rs
+++ b/library/std/src/sys/unix/futex.rs
@@ -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)?));