Home | History | Annotate | Download | only in runtime

Lines Matching defs:sig

10 // via struct sig, below.
14 // Synchronization between sigsend and signal_recv is based on the sig.state
16 // sigReceiving means that signal_recv is blocked on sig.Note and there are no
18 // sigSending means that sig.mask *may* contain new pending signals,
22 // When signal_recv is unblocked, it resets sig.Note and rechecks sig.mask.
24 // unnecessary rechecks of sig.mask, but it cannot lead to missed signals
33 var sig struct {
52 if !sig.inuse || s < 0 || int(s) >= 32*len(sig.wanted) || sig.wanted[s/32]&bit == 0 {
58 mask := sig.mask[s/32]
62 if cas(&sig.mask[s/32], mask, mask|bit) {
70 switch atomicload(&sig.state) {
74 if cas(&sig.state, sigIdle, sigSending) {
81 if cas(&sig.state, sigReceiving, sigIdle) {
82 notewakeup(&sig.note)
97 if sig.recv[i/32]&(1<<(i&31)) != 0 {
98 sig.recv[i/32] &^= 1 << (i & 31)
106 switch atomicload(&sig.state) {
110 if cas(&sig.state, sigIdle, sigReceiving) {
111 notetsleepg(&sig.note, -1)
112 noteclear(&sig.note)
116 if cas(&sig.state, sigSending, sigIdle) {
123 for i := range sig.mask {
124 sig.recv[i] = xchg(&sig.mask[i], 0)
131 if !sig.inuse {
135 sig.inuse = true // enable reception of signals; cannot disable
136 noteclear(&sig.note)
140 if int(s) >= len(sig.wanted)*32 {
143 sig.wanted[s/32] |= 1 << (s & 31)
149 if int(s) >= len(sig.wanted)*32 {
152 sig.wanted[s/32] &^= 1 << (s & 31)
158 if int(s) >= len(sig.wanted)*32 {
161 sig.wanted[s/32] &^= 1 << (s & 31)
168 func badsignal(sig uintptr) {
169 cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig))
172 func badsignalgo(sig uintptr) {
173 if !sigsend(uint32(sig)) {
174 // A foreign thread received the signal sig, and the
176 raisebadsignal(int32(sig))