Imports #
"context"
"os"
"slices"
"sync"
"os"
"syscall"
"os"
"syscall"
"context"
"os"
"slices"
"sync"
"os"
"syscall"
"os"
"syscall"
var handlers struct{...}
const numSig = 256
const numSig = 65
var sigtab = *ast.CallExpr
var watchSignalLoop func()
watchSignalLoopOnce guards calling the conditionally initialized watchSignalLoop. If watchSignalLoop is non-nil, it will be run in a goroutine lazily once Notify is invoked. See Issue 21576.
var watchSignalLoopOnce sync.Once
type stringer interface {
String() string
}
type handler struct {
mask [*ast.BinaryExpr]uint32
}
type signalCtx struct {
context.Context
cancel context.CancelFunc
signals []os.Signal
ch chan os.Signal
}
type stopping struct {
c chan<- os.Signal
h *handler
}
Ignore causes the provided signals to be ignored. If they are received by the program, nothing will happen. Ignore undoes the effect of any prior calls to [Notify] for the provided signals. If no signals are provided, all incoming signals will be ignored.
func Ignore(sig ...os.Signal)
Ignored reports whether sig is currently ignored.
func Ignored(sig os.Signal) bool
Notify causes package signal to relay incoming signals to c. If no signals are provided, all incoming signals will be relayed to c. Otherwise, just the provided signals will. Package signal will not block sending to c: the caller must ensure that c has sufficient buffer space to keep up with the expected signal rate. For a channel used for notification of just one signal value, a buffer of size 1 is sufficient. It is allowed to call Notify multiple times with the same channel: each call expands the set of signals sent to that channel. The only way to remove signals from the set is to call [Stop]. It is allowed to call Notify multiple times with different channels and the same signals: each channel receives copies of incoming signals independently.
func Notify(c chan<- os.Signal, sig ...os.Signal)
NotifyContext returns a copy of the parent context that is marked done (its Done channel is closed) when one of the listed signals arrives, when the returned stop function is called, or when the parent context's Done channel is closed, whichever happens first. The stop function unregisters the signal behavior, which, like [signal.Reset], may restore the default behavior for a given signal. For example, the default behavior of a Go program receiving [os.Interrupt] is to exit. Calling NotifyContext(parent, os.Interrupt) will change the behavior to cancel the returned context. Future interrupts received will not trigger the default (exit) behavior until the returned stop function is called. The stop function releases resources associated with it, so code should call stop as soon as the operations running in this Context complete and signals no longer need to be diverted to the context.
func NotifyContext(parent context.Context, signals ...os.Signal) (ctx context.Context, stop context.CancelFunc)
Reset undoes the effect of any prior calls to [Notify] for the provided signals. If no signals are provided, all signal handlers will be reset.
func Reset(sig ...os.Signal)
Stop causes package signal to stop relaying incoming signals to c. It undoes the effect of all prior calls to [Notify] using c. When Stop returns, it is guaranteed that c will receive no more signals.
func Stop(c chan<- os.Signal)
func (c *signalCtx) String() string
Stop relaying the signals, sigs, to any channels previously registered to receive them and either reset the signal handlers to their original values (action=disableSignal) or ignore the signals (action=ignoreSignal).
func cancel(sigs []os.Signal, action func(int))
func (h *handler) clear(sig int)
func disableSignal(sig int)
func disableSignal(sig int)
func enableSignal(sig int)
func enableSignal(sig int)
func ignoreSignal(sig int)
func ignoreSignal(sig int)
func init()
func init()
func loop()
func loop()
func process(sig os.Signal)
func (h *handler) set(sig int)
func signalIgnored(sig int) bool
func signalIgnored(sig int) bool
Wait until there are no more signals waiting to be delivered. Defined by the runtime package.
func signalWaitUntilIdle()
Defined by the runtime package.
func signal_disable(uint32)
Defined by the runtime package.
func signal_disable(uint32)
func signal_enable(uint32)
func signal_enable(uint32)
func signal_ignore(uint32)
func signal_ignore(uint32)
func signal_ignored(uint32) bool
func signal_ignored(uint32) bool
func signal_recv() uint32
func signal_recv() string
func signum(sig os.Signal) int
func signum(sig os.Signal) int
func (c *signalCtx) stop()
func (h *handler) want(sig int) bool
Generated with Arrow