Skip to content

Commit d2120e6

Browse files
committed
Work around cygwin issue on timeout
1 parent be181dd commit d2120e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/std/src/sys/pal/unix/sync/condvar.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ impl Condvar {
6464
// https://gist.github.com/stepancheg/198db4623a20aad2ad7cddb8fda4a63c
6565
//
6666
// To work around this issue, the timeout is clamped to 1000 years.
67-
#[cfg(target_vendor = "apple")]
67+
//
68+
// Cygwin implementation is based on NT API and a super large timeout
69+
// makes the syscall block forever.
70+
#[cfg(any(target_vendor = "apple", target_os = "cygwin"))]
6871
let dur = Duration::min(dur, Duration::from_secs(1000 * 365 * 86400));
6972

7073
let timeout = Timespec::now(Self::CLOCK).checked_add_duration(&dur);

0 commit comments

Comments
 (0)