File tree 3 files changed +4
-19
lines changed
3 files changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ public class _stdlib_Barrier {
126
126
public init ( threadCount: Int ) {
127
127
self . _pthreadBarrier = _stdlib_pthread_barrier_t ( )
128
128
let ret = _stdlib_pthread_barrier_init (
129
- _pthreadBarrierPtr, nil , CUnsignedInt ( threadCount) )
129
+ _pthreadBarrierPtr, CUnsignedInt ( threadCount) )
130
130
if ret != 0 {
131
131
fatalError ( " _stdlib_pthread_barrier_init() failed " )
132
132
}
Original file line number Diff line number Diff line change 14
14
import Darwin
15
15
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
16
16
import Glibc
17
+ #elseif os(Windows)
18
+ import MSVCRT
17
19
#endif
18
20
19
21
//
@@ -22,22 +24,6 @@ import Glibc
22
24
// (OS X does not implement them.)
23
25
//
24
26
25
- public struct _stdlib_pthread_barrierattr_t {
26
- public init ( ) { }
27
- }
28
-
29
- public func _stdlib_pthread_barrierattr_init(
30
- _ attr: UnsafeMutablePointer < _stdlib_pthread_barrierattr_t >
31
- ) -> CInt {
32
- return 0
33
- }
34
-
35
- public func _stdlib_pthread_barrierattr_destroy(
36
- _ attr: UnsafeMutablePointer < _stdlib_pthread_barrierattr_t >
37
- ) -> CInt {
38
- return 0
39
- }
40
-
41
27
public var _stdlib_PTHREAD_BARRIER_SERIAL_THREAD : CInt {
42
28
return 1
43
29
}
@@ -64,7 +50,6 @@ public struct _stdlib_pthread_barrier_t {
64
50
65
51
public func _stdlib_pthread_barrier_init(
66
52
_ barrier: UnsafeMutablePointer < _stdlib_pthread_barrier_t > ,
67
- _ attr: UnsafeMutablePointer < _stdlib_pthread_barrierattr_t > ? ,
68
53
_ count: CUnsignedInt
69
54
) -> CInt {
70
55
barrier. pointee = _stdlib_pthread_barrier_t ( )
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ func sliceConcurrentAppendThread(_ tid: ThreadID) {
90
90
StringTestSuite . test ( " SliceConcurrentAppend " ) {
91
91
barrierVar = UnsafeMutablePointer . allocate ( capacity: 1 )
92
92
barrierVar!. initialize ( to: _stdlib_pthread_barrier_t ( ) )
93
- var ret = _stdlib_pthread_barrier_init ( barrierVar!, nil , 2 )
93
+ var ret = _stdlib_pthread_barrier_init ( barrierVar!, 2 )
94
94
expectEqual ( 0 , ret)
95
95
96
96
let ( createRet1, tid1) = _stdlib_pthread_create_block (
You can’t perform that action at this time.
0 commit comments