Skip to content

Commit adb12bf

Browse files
authored
Add WebAssembly support (#273)
1 parent 2ace701 commit adb12bf

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/AsyncAlgorithms/Locking.swift

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ internal struct Lock {
2424
typealias Primitive = pthread_mutex_t
2525
#elseif canImport(WinSDK)
2626
typealias Primitive = SRWLOCK
27+
#else
28+
typealias Primitive = Int
2729
#endif
2830

2931
typealias PlatformLock = UnsafeMutablePointer<Primitive>

Sources/AsyncSequenceValidation/TaskDriver.swift

+4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ final class TaskDriver {
5050
}
5151

5252
func start() {
53+
#if canImport(Darwin) || canImport(Glibc)
5354
pthread_create(&thread, nil, start_thread,
5455
Unmanaged.passRetained(self).toOpaque())
56+
#elseif canImport(WinSDK)
57+
#error("TODO: Port TaskDriver threading to windows")
58+
#endif
5559
}
5660

5761
func run() {

0 commit comments

Comments
 (0)