File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
stdlib/public/Synchronization/Mutex Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 13
13
// Note: All atomic accesses on WASM are sequentially consistent regardless of
14
14
// what ordering we tell LLVM to use.
15
15
16
- @_extern ( c, " llvm.wasm32 .memory.atomic.wait32 " )
16
+ @_extern ( c, " llvm.wasm .memory.atomic.wait32 " )
17
17
internal func _swift_stdlib_wait(
18
18
on: UnsafePointer < UInt32 > ,
19
19
expected: UInt32 ,
20
20
timeout: Int64
21
21
) -> UInt32
22
22
23
- @_extern ( c, " llvm.wasm32 .memory.atomic.notify " )
24
- internal func _swift_stdlib_wake( on: UnsafePointer < UInt32 > , count: UInt32 )
23
+ @_extern ( c, " llvm.wasm .memory.atomic.notify " )
24
+ internal func _swift_stdlib_wake( on: UnsafePointer < UInt32 > , count: UInt32 ) -> UInt32
25
25
26
26
extension Atomic where Value == _MutexHandle . State {
27
27
internal borrowing func _wait( expected: _MutexHandle . State ) {
28
- _swift_stdlib_wait (
28
+ #if _runtime(_multithreaded)
29
+ _ = _swift_stdlib_wait (
29
30
on: . init( _rawAddress) ,
30
31
expected: expected. rawValue,
31
32
32
33
// A timeout of < 0 means indefinitely.
33
34
timeout: - 1
34
35
)
36
+ #endif
35
37
}
36
38
37
39
internal borrowing func _wake( ) {
40
+ #if _runtime(_multithreaded)
38
41
// Only wake up 1 thread
39
- _swift_stdlib_wake ( on: . init( _rawAddress) , count: 1 )
42
+ _ = _swift_stdlib_wake ( on: . init( _rawAddress) , count: 1 )
43
+ #endif
40
44
}
41
45
}
42
46
You can’t perform that action at this time.
0 commit comments