88 See http://swift.org/CONTRIBUTORS.txt for Swift project authors
99*/
1010
11- import class Foundation. ProcessInfo
1211import protocol Foundation. CustomNSError
1312import var Foundation. NSLocalizedDescriptionKey
13+ import class Foundation. NSLock
14+ import class Foundation. ProcessInfo
1415
1516#if os(Windows)
1617import Foundation
@@ -208,7 +209,7 @@ public final class Process {
208209 public typealias LoggingHandler = ( String ) -> Void
209210
210211 private static var _loggingHandler : LoggingHandler ?
211- private static let loggingHandlerLock = Lock ( )
212+ private static let loggingHandlerLock = NSLock ( )
212213
213214 /// Global logging handler. Use with care! preferably use instance level instead of setting one globally.
214215 public static var loggingHandler : LoggingHandler ? {
@@ -237,7 +238,7 @@ public final class Process {
237238
238239 // the log and setter are only required to backward support verbose setter.
239240 // remove and make loggingHandler a let property once verbose is deprecated
240- private let loggingHandlerLock = Lock ( )
241+ private let loggingHandlerLock = NSLock ( )
241242 public private( set) var loggingHandler : LoggingHandler ? {
242243 get {
243244 self . loggingHandlerLock. withLock {
@@ -290,7 +291,7 @@ public final class Process {
290291
291292 // process execution mutable state
292293 private var state : State = . idle
293- private let stateLock = Lock ( )
294+ private let stateLock = NSLock ( )
294295
295296 private static let sharedCompletionQueue = DispatchQueue ( label: " org.swift.tools-support-core.process-completion " )
296297 private var completionQueue = Process . sharedCompletionQueue
@@ -311,7 +312,7 @@ public final class Process {
311312
312313 // ideally we would use the state for this, but we need to access it while the waitForExit is locking state
313314 private var _launched = false
314- private let launchedLock = Lock ( )
315+ private let launchedLock = NSLock ( )
315316
316317 public var launched : Bool {
317318 return self . launchedLock. withLock {
@@ -330,7 +331,7 @@ public final class Process {
330331 /// Key: Executable name or path.
331332 /// Value: Path to the executable, if found.
332333 private static var validatedExecutablesMap = [ String: AbsolutePath? ] ( )
333- private static let validatedExecutablesMapLock = Lock ( )
334+ private static let validatedExecutablesMapLock = NSLock ( )
334335
335336 /// Create a new process instance.
336337 ///
@@ -727,7 +728,7 @@ public final class Process {
727728 }
728729 } else {
729730 var pending : Result < [ UInt8 ] , Swift . Error > ?
730- let pendingLock = Lock ( )
731+ let pendingLock = NSLock ( )
731732
732733 let outputClosures = outputRedirection. outputClosures
733734
0 commit comments