mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib: remove pthread_attr_t from _stdlib_pthread_create_block
The attributes were not being used currently. Since this is a private interface, remove the parameter as it makes it easier to port to Windows.
This commit is contained in:
@@ -59,15 +59,8 @@ internal func invokeBlockContext(
|
||||
return context.run()
|
||||
}
|
||||
|
||||
#if os(Cygwin) || os(FreeBSD) || os(Haiku)
|
||||
public typealias _stdlib_pthread_attr_t = UnsafePointer<pthread_attr_t?>
|
||||
#else
|
||||
public typealias _stdlib_pthread_attr_t = UnsafePointer<pthread_attr_t>
|
||||
#endif
|
||||
|
||||
/// Block-based wrapper for `pthread_create`.
|
||||
public func _stdlib_pthread_create_block<Argument, Result>(
|
||||
_ attr: _stdlib_pthread_attr_t?,
|
||||
_ start_routine: @escaping (Argument) -> Result,
|
||||
_ arg: Argument
|
||||
) -> (CInt, pthread_t?) {
|
||||
@@ -77,7 +70,7 @@ public func _stdlib_pthread_create_block<Argument, Result>(
|
||||
let contextAsVoidPointer = Unmanaged.passRetained(context).toOpaque()
|
||||
|
||||
var threadID = _make_pthread_t()
|
||||
let result = pthread_create(&threadID, attr,
|
||||
let result = pthread_create(&threadID, nil,
|
||||
{ invokeBlockContext($0) }, contextAsVoidPointer)
|
||||
if result == 0 {
|
||||
return (result, threadID)
|
||||
|
||||
Reference in New Issue
Block a user