How to terminate all threads reading from Pipe (NSPipe) related to Process (NSTask)?
问题 I am writing a MacOS/Cocoa app that monitors a remote log file using a common recipe that launches a Process (formerly NSTask ) instance on a background thread and reads stdout of the process via a Pipe (formally a NSPipe ) as listed below: class LogTail { var process : Process? = nil func dolog() { // // Run ssh fred@foo.org /usr/bin/tail -f /var/log.system.log // on a background thread and monitor it's stdout. // let processQueue = DispatchQueue.global(qos: .background) processQueue.async {