Avatar
norio_nomura 6/2/2018 5:40 AM
Process.waitUntilExit()がスレッドセーフではないため、Process.terminationStatusがおかしくなる。 @swift-4.2.4 import Foundation let process = Process() process.launchPath = "/bin/false" let group = DispatchGroup(), queue = DispatchQueue.global() process.launch() queue.async(group: group) { process.waitUntilExit() } group.wait() print("terminationStatus should be 1, actual: \(process.terminationStatus)") (edited)