File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ import Darwin
1616import Glibc
1717#endif
1818
19- // FIXME: On FreeBSD, code in this file doesn't compile
20- #if !os(FreeBSD)
2119//
2220// Implement pthread barriers.
2321//
@@ -45,8 +43,13 @@ public var _stdlib_PTHREAD_BARRIER_SERIAL_THREAD: CInt {
4543}
4644
4745public struct _stdlib_pthread_barrier_t {
46+ #if CYGWIN || os(FreeBSD)
47+ var mutex : UnsafeMutablePointer < pthread_mutex_t ? > ? = nil
48+ var cond : UnsafeMutablePointer < pthread_cond_t ? > ? = nil
49+ #else
4850 var mutex : UnsafeMutablePointer < pthread_mutex_t > ? = nil
4951 var cond : UnsafeMutablePointer < pthread_cond_t > ? = nil
52+ #endif
5053
5154 /// The number of threads to synchronize.
5255 var count : CUnsignedInt = 0
@@ -131,4 +134,3 @@ public func _stdlib_pthread_barrier_wait(
131134 return _stdlib_PTHREAD_BARRIER_SERIAL_THREAD
132135 }
133136}
134- #endif
Original file line number Diff line number Diff line change @@ -21,8 +21,6 @@ import Darwin
2121import Glibc
2222#endif
2323
24- // FIXME: On FreeBSD, code in this file doesn't compile
25- #if !os(FreeBSD)
2624/// An abstract base class to encapsulate the context necessary to invoke
2725/// a block from pthread_create.
2826internal class PthreadBlockContext {
@@ -61,9 +59,15 @@ internal func invokeBlockContext(
6159 return context. run ( )
6260}
6361
62+ #if CYGWIN || os(FreeBSD)
63+ public typealias _stdlib_pthread_attr_t = UnsafePointer < pthread_attr_t ? >
64+ #else
65+ public typealias _stdlib_pthread_attr_t = UnsafePointer < pthread_attr_t >
66+ #endif
67+
6468/// Block-based wrapper for `pthread_create`.
6569public func _stdlib_pthread_create_block< Argument, Result> (
66- _ attr: UnsafePointer < pthread_attr_t > ? ,
70+ _ attr: _stdlib_pthread_attr_t ? ,
6771 _ start_routine: @escaping ( Argument ) -> Result ,
6872 _ arg: Argument
6973) -> ( CInt , pthread_t ? ) {
@@ -142,4 +146,3 @@ public class _stdlib_Barrier {
142146 }
143147 }
144148}
145- #endif
You can’t perform that action at this time.
0 commit comments