func updatePM() {
signal(SIGINT, SIG_IGN)
let sigintSrc = DispatchSource.makeSignalSource(signal: SIGINT, queue: nil)
sigintSrc.setEventHandler {
// I wanna stop this func()
}
sigintSrc.resume()
// do something(I can't controll it, it's a api)
}
How can I do to stop this func. 'do somthing' just like execute some command in ssh, is a third party api(Shout)