File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -162,10 +162,7 @@ public class _stdlib_Barrier {
162
162
}
163
163
164
164
deinit {
165
- let ret = _stdlib_thread_barrier_destroy ( _threadBarrierPtr)
166
- if ret != 0 {
167
- fatalError ( " _stdlib_thread_barrier_destroy() failed " )
168
- }
165
+ _stdlib_thread_barrier_destroy ( _threadBarrierPtr)
169
166
}
170
167
171
168
public func wait( ) {
Original file line number Diff line number Diff line change @@ -94,14 +94,14 @@ private func _stdlib_pthread_barrier_mutex_and_cond_init(_ barrier: UnsafeMutabl
94
94
95
95
public func _stdlib_thread_barrier_destroy(
96
96
_ barrier: UnsafeMutablePointer < _stdlib_thread_barrier_t >
97
- ) -> CInt {
97
+ ) {
98
98
#if os(Windows)
99
99
// Condition Variables do not need to be explicitly destroyed
100
100
// Mutexes do not need to be explicitly destroyed
101
101
#else
102
102
guard pthread_cond_destroy ( barrier. pointee. cond!) == 0 &&
103
103
pthread_mutex_destroy ( barrier. pointee. mutex!) == 0 else {
104
- return - 1
104
+ fatalError ( " _stdlib_thread_barrier_destroy() failed " )
105
105
}
106
106
#endif
107
107
barrier. pointee. cond!. deinitialize ( count: 1 )
@@ -110,7 +110,7 @@ public func _stdlib_thread_barrier_destroy(
110
110
barrier. pointee. mutex!. deinitialize ( count: 1 )
111
111
barrier. pointee. mutex!. deallocate ( )
112
112
113
- return 0
113
+ return
114
114
}
115
115
116
116
public func _stdlib_thread_barrier_wait(
Original file line number Diff line number Diff line change @@ -111,8 +111,7 @@ StringTestSuite.test("SliceConcurrentAppend") {
111
111
expectEqual ( 0 , joinRet1)
112
112
expectEqual ( 0 , joinRet2)
113
113
114
- ret = _stdlib_thread_barrier_destroy ( barrierVar!)
115
- expectEqual ( 0 , ret)
114
+ _stdlib_thread_barrier_destroy ( barrierVar!)
116
115
117
116
barrierVar!. deinitialize ( count: 1 )
118
117
barrierVar!. deallocate ( )
You can’t perform that action at this time.
0 commit comments