Skip to content
This repository was archived by the owner on Dec 15, 2024. It is now read-only.

Commit e1a7db9

Browse files
committed
Working on Thread for latest Swift 3.0 on Linux
1 parent e43136e commit e1a7db9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/SwiftFoundation/Thread.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public final class Thread {
2525

2626
let holder = Unmanaged.passRetained(Closure(closure: closure))
2727

28-
let pointer = UnsafeMutablePointer<Void>(OpaquePointer(bitPattern: holder))
29-
3028
#if os(Linux)
3129

30+
let pointer = UnsafeMutablePointer<Void>(holder.toOpaque())
31+
3232
var internalThread: pthread_t = 0
3333

3434
guard pthread_create(&internalThread, nil, ThreadPrivateMainLinux, pointer) == 0
@@ -40,6 +40,8 @@ public final class Thread {
4040

4141
#elseif os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
4242

43+
let pointer = UnsafeMutablePointer<Void>(OpaquePointer(bitPattern: holder))
44+
4345
var internalThread: pthread_t? = nil
4446

4547
guard pthread_create(&internalThread, nil, ThreadPrivateMainDarwin, pointer) == 0

0 commit comments

Comments
 (0)