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

Delta Between Two Patch Sets: src/pkg/runtime/proc.c

Issue 12371043: code review 12371043: runtime: remove debugging knob to turn off preemption (Closed)
Left Patch Set: Created 11 years, 7 months ago
Right Patch Set: diff -r 0f70059daaf1 https://code.google.com/p/go/ Created 11 years, 7 months 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:
Right: Side by side diff | Download
« no previous file with change/comment | « doc/go1.2.txt ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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 #include "runtime.h" 5 #include "runtime.h"
6 #include "arch_GOARCH.h" 6 #include "arch_GOARCH.h"
7 #include "malloc.h" 7 #include "malloc.h"
8 #include "stack.h" 8 #include "stack.h"
9 #include "race.h" 9 #include "race.h"
10 #include "type.h" 10 #include "type.h"
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 // goroutine. It can send inform the wrong goroutine. Even if it informs the 2264 // goroutine. It can send inform the wrong goroutine. Even if it informs the
2265 // correct goroutine, that goroutine might ignore the request if it is 2265 // correct goroutine, that goroutine might ignore the request if it is
2266 // simultaneously executing runtime·newstack. 2266 // simultaneously executing runtime·newstack.
2267 // No lock needs to be held. 2267 // No lock needs to be held.
2268 static void 2268 static void
2269 preemptone(P *p) 2269 preemptone(P *p)
2270 { 2270 {
2271 M *mp; 2271 M *mp;
2272 G *gp; 2272 G *gp;
2273 2273
2274 // Preemption requires more robust traceback routines.
2275 // For now, disable.
2276 // The if(1) silences a compiler warning about the rest of the
2277 // function being unreachable.
2278 if(0) return;
2279
2280 mp = p->m; 2274 mp = p->m;
2281 if(mp == nil || mp == m) 2275 if(mp == nil || mp == m)
2282 return; 2276 return;
2283 gp = mp->curg; 2277 gp = mp->curg;
2284 if(gp == nil || gp == mp->g0) 2278 if(gp == nil || gp == mp->g0)
2285 return; 2279 return;
2286 gp->preempt = true; 2280 gp->preempt = true;
2287 gp->stackguard0 = StackPreempt; 2281 gp->stackguard0 = StackPreempt;
2288 } 2282 }
2289 2283
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
2599 bool 2593 bool
2600 runtime·topofstack(Func *f) 2594 runtime·topofstack(Func *f)
2601 { 2595 {
2602 return f->entry == (uintptr)runtime·goexit || 2596 return f->entry == (uintptr)runtime·goexit ||
2603 f->entry == (uintptr)runtime·mstart || 2597 f->entry == (uintptr)runtime·mstart ||
2604 f->entry == (uintptr)runtime·mcall || 2598 f->entry == (uintptr)runtime·mcall ||
2605 f->entry == (uintptr)runtime·morestack || 2599 f->entry == (uintptr)runtime·morestack ||
2606 f->entry == (uintptr)runtime·lessstack || 2600 f->entry == (uintptr)runtime·lessstack ||
2607 f->entry == (uintptr)_rt0_go; 2601 f->entry == (uintptr)_rt0_go;
2608 } 2602 }
LEFTRIGHT

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