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

Commit

Permalink
Working on Thread for latest Swift 3.0 on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Jul 2, 2016
1 parent e43136e commit e1a7db9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/SwiftFoundation/Thread.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public final class Thread {

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

let pointer = UnsafeMutablePointer<Void>(OpaquePointer(bitPattern: holder))

#if os(Linux)

let pointer = UnsafeMutablePointer<Void>(holder.toOpaque())

var internalThread: pthread_t = 0

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

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

let pointer = UnsafeMutablePointer<Void>(OpaquePointer(bitPattern: holder))

var internalThread: pthread_t? = nil

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

0 comments on commit e1a7db9

Please sign in to comment.