mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-24 04:17:52 +00:00
Add WebAssembly support (#273)
This commit is contained in:
1 parent
2ace7010e9
commit
adb12bfccc
2 files changed
+6
No files matched your search
@@ -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>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user