const SIGHUP
XuAPI
pub const SIGHUP = 1用途
常量 SIGHUP,定义了相关的协议或算法配置参数。
#os/signalUnix 信号编号。notify 未接到内核,调用即 throw,避免静默丢信号。
const SIGHUPpub const SIGHUP = 1常量 SIGHUP,定义了相关的协议或算法配置参数。
const INTERRUPTpub const INTERRUPT = 2常量 INTERRUPT,定义了相关的协议或算法配置参数。
const SIGINTpub const SIGINT = 2常量 SIGINT,定义了相关的协议或算法配置参数。
const SIGQUITpub const SIGQUIT = 3常量 SIGQUIT,定义了相关的协议或算法配置参数。
const KILLpub const KILL = 9常量 KILL,定义了相关的协议或算法配置参数。
const SIGKILLpub const SIGKILL = 9常量 SIGKILL,定义了相关的协议或算法配置参数。
const SIGPIPEpub const SIGPIPE = 13常量 SIGPIPE,定义了相关的协议或算法配置参数。
const SIGTERMpub const SIGTERM = 15常量 SIGTERM,定义了相关的协议或算法配置参数。
struct Notifierpub struct Notifier {
pub ch chan int
pub sig int
pub active bool
}承载 ch、sig、active 等属性的结构体。
ch chan intsig intactive boolnew_notifierpub fn new_notifier(c chan int, sig int) Notifier构造 notifier。
c chan intsig intNotifier — 该类型的值
($&Notifier) stoppub fn (n $&Notifier) stop()$&Notifier 上的操作:停止。
n $&NotifierNotifier 实例;以独占借用传入,方法可修改它,调用方仍持有实例。不返回值。
(&Notifier) raisepub fn (n &Notifier) raise(sig int) bool在 &Notifier 上执行 raise 操作。
n &NotifierNotifier 实例;以只读借用传入,调用方仍持有实例。sig intbool — 是否成立
notifypub fn notify(c chan int, sig int) int通知。失败时抛出错误,调用方需处理或继续传播。
c chan intsig intint — 该类型的值
stoppub fn stop(c chan int) int停止。
c chan intint — 该类型的值
ignorepub fn ignore(sig int) int忽略。失败时抛出错误,调用方需处理或继续传播。
sig intint — 该类型的值
raisepub fn raise(c chan int, sig int) bool执行 raise 处理。
c chan intsig intbool — 是否成立