Skip to content

Commit 4d6aa73

Browse files
committed
Distributed: Add unsafe keyword to uses of pthreads.
1 parent 0ff1392 commit 4d6aa73

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/public/Distributed/LocalTestingDistributedActorSystem.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ fileprivate class _Lock {
261261
// WASI environment has only a single thread
262262
#else
263263
self.underlying = UnsafeMutablePointer.allocate(capacity: 1)
264-
guard pthread_mutex_init(self.underlying, nil) == 0 else {
264+
guard unsafe pthread_mutex_init(self.underlying, nil) == 0 else {
265265
fatalError("pthread_mutex_init failed")
266266
}
267267
#endif
@@ -275,7 +275,7 @@ fileprivate class _Lock {
275275
#elseif os(WASI)
276276
// WASI environment has only a single thread
277277
#else
278-
guard pthread_mutex_destroy(self.underlying) == 0 else {
278+
guard unsafe pthread_mutex_destroy(self.underlying) == 0 else {
279279
fatalError("pthread_mutex_destroy failed")
280280
}
281281
#endif
@@ -296,7 +296,7 @@ fileprivate class _Lock {
296296
#elseif os(WASI)
297297
// WASI environment has only a single thread
298298
#else
299-
guard pthread_mutex_lock(self.underlying) == 0 else {
299+
guard unsafe pthread_mutex_lock(self.underlying) == 0 else {
300300
fatalError("pthread_mutex_lock failed")
301301
}
302302
#endif
@@ -309,7 +309,7 @@ fileprivate class _Lock {
309309
#elseif os(WASI)
310310
// WASI environment has only a single thread
311311
#else
312-
guard pthread_mutex_unlock(self.underlying) == 0 else {
312+
guard unsafe pthread_mutex_unlock(self.underlying) == 0 else {
313313
fatalError("pthread_mutex_unlock failed")
314314
}
315315
#endif

0 commit comments

Comments
 (0)