Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(184)

Side by Side Diff: src/pkg/runtime/sigqueue.goc

Issue 5656048: code review 5656048: runtime, syscall, os/signal: fix windows build (Closed)
Patch Set: diff -r 15d7c8abf2ba https://go.googlecode.com/hg/ Created 13 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/runtime/signal_windows_amd64.c ('k') | src/pkg/runtime/thread_windows.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // This file implements runtime support for signal handling. 5 // This file implements runtime support for signal handling.
6 // 6 //
7 // Most synchronization primitives are not available from 7 // Most synchronization primitives are not available from
8 // the signal handler (it cannot block and cannot use locks) 8 // the signal handler (it cannot block and cannot use locks)
9 // so the handler communicates with a processing goroutine 9 // so the handler communicates with a processing goroutine
10 // via struct sig, below. 10 // via struct sig, below.
11 // 11 //
12 // Ownership for sig.Note passes back and forth between 12 // Ownership for sig.Note passes back and forth between
13 // the signal handler and the signal goroutine in rounds. 13 // the signal handler and the signal goroutine in rounds.
14 // The initial state is that sig.note is cleared (setup by siginit). 14 // The initial state is that sig.note is cleared (setup by signal_enable).
15 // At the beginning of each round, mask == 0. 15 // At the beginning of each round, mask == 0.
16 // The round goes through three stages: 16 // The round goes through three stages:
17 // 17 //
18 // (In parallel) 18 // (In parallel)
19 // 1a) One or more signals arrive and are handled 19 // 1a) One or more signals arrive and are handled
20 // by sigsend using cas to set bits in sig.mask. 20 // by sigsend using cas to set bits in sig.mask.
21 // The handler that changes sig.mask from zero to non-zero 21 // The handler that changes sig.mask from zero to non-zero
22 // calls notewakeup(&sig). 22 // calls notewakeup(&sig).
23 // 1b) Sigrecv calls notesleep(&sig) to wait for the wakeup. 23 // 1b) Sigrecv calls notesleep(&sig) to wait for the wakeup.
24 // 24 //
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // Special case: want everything. 140 // Special case: want everything.
141 for(i=0; i<nelem(sig.wanted); i++) 141 for(i=0; i<nelem(sig.wanted); i++)
142 sig.wanted[i] = ~(uint32)0; 142 sig.wanted[i] = ~(uint32)0;
143 return; 143 return;
144 } 144 }
145 145
146 if(s >= nelem(sig.wanted)*32) 146 if(s >= nelem(sig.wanted)*32)
147 return; 147 return;
148 sig.wanted[s/32] |= 1U<<(s&31); 148 sig.wanted[s/32] |= 1U<<(s&31);
149 } 149 }
OLDNEW
« no previous file with comments | « src/pkg/runtime/signal_windows_amd64.c ('k') | src/pkg/runtime/thread_windows.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b