Skip to content

Commit

Permalink
Add WebAssembly support (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpablo authored Jun 23, 2023
1 parent 2ace701 commit adb12bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/AsyncAlgorithms/Locking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ internal struct Lock {
typealias Primitive = pthread_mutex_t
#elseif canImport(WinSDK)
typealias Primitive = SRWLOCK
#else
typealias Primitive = Int
#endif

typealias PlatformLock = UnsafeMutablePointer<Primitive>
Expand Down
4 changes: 4 additions & 0 deletions Sources/AsyncSequenceValidation/TaskDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ final class TaskDriver {
}

func start() {
#if canImport(Darwin) || canImport(Glibc)
pthread_create(&thread, nil, start_thread,
Unmanaged.passRetained(self).toOpaque())
#elseif canImport(WinSDK)
#error("TODO: Port TaskDriver threading to windows")
#endif
}

func run() {
Expand Down

0 comments on commit adb12bf

Please sign in to comment.