1111//
1212//===----------------------------------------------------------------------===//
1313
14- // Vendored from NIO 2.83 .0
14+ // Vendored from NIO 2.86 .0
1515
1616//===----------------------------------------------------------------------===//
1717//
@@ -33,18 +33,25 @@ import Darwin
3333import ucrt
3434import WinSDK
3535#elseif canImport(Glibc)
36- import Glibc
36+ @ preconcurrency import Glibc
3737#elseif canImport(Musl)
38- import Musl
38+ @preconcurrency import Musl
39+ #elseif canImport(Bionic)
40+ @preconcurrency import Bionic
41+ #elseif canImport(WASILibc)
42+ @preconcurrency import WASILibc
43+ #if canImport(wasi_pthread)
44+ import wasi_pthread
45+ #endif
3946#else
4047#error("The concurrency lock module was unable to identify your C library.")
4148#endif
4249
43- /// A `Lock` with a built-in state variable.
44- ///
45- /// This class provides a convenience addition to `Lock`: it provides the ability to wait
46- /// until the state variable is set to a specific value to acquire the lock.
4750extension Locking {
51+ /// A `Lock` with a built-in state variable.
52+ ///
53+ /// This class provides a convenience addition to `Lock`: it provides the ability to wait
54+ /// until the state variable is set to a specific value to acquire the lock.
4855 public final class ConditionLock < T: Equatable > {
4956 private var _value : T
5057 private let mutex : FastLock
@@ -170,11 +177,7 @@ extension Locking {
170177 gettimeofday ( & curTime, nil )
171178
172179 let allNSecs : Int64 = timeoutNS + Int64( curTime. tv_usec) * 1000
173- #if canImport(wasi_pthread)
174- let tvSec = curTime. tv_sec + ( allNSecs / nsecPerSec)
175- #else
176- let tvSec = curTime. tv_sec + Int( ( allNSecs / nsecPerSec) )
177- #endif
180+ let tvSec = curTime. tv_sec + time_t( ( allNSecs / nsecPerSec) )
178181
179182 var timeoutAbs = timespec (
180183 tv_sec: tvSec,
0 commit comments