Skip to content

Commit e74f745

Browse files
iachieveditphausler
authored andcommitted
SR-1908 Set detach state on creation to DETACHED (#425)
1 parent bc80c54 commit e74f745

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Foundation/NSThread.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ public class Thread: NSObject {
146146
_main = main
147147
let _ = withUnsafeMutablePointer(&_attr) { attr in
148148
pthread_attr_init(attr)
149+
pthread_attr_setscope(attr, Int32(PTHREAD_SCOPE_SYSTEM))
150+
pthread_attr_setdetachstate(attr, Int32(PTHREAD_CREATE_DETACHED))
149151
}
150152
}
151153

0 commit comments

Comments
 (0)