LEFT | RIGHT |
(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 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1829 if(n > MaxGomaxprocs) | 1829 if(n > MaxGomaxprocs) |
1830 n = MaxGomaxprocs; | 1830 n = MaxGomaxprocs; |
1831 runtime·lock(&runtime·sched); | 1831 runtime·lock(&runtime·sched); |
1832 ret = runtime·gomaxprocs; | 1832 ret = runtime·gomaxprocs; |
1833 if(n <= 0 || n == ret) { | 1833 if(n <= 0 || n == ret) { |
1834 runtime·unlock(&runtime·sched); | 1834 runtime·unlock(&runtime·sched); |
1835 return ret; | 1835 return ret; |
1836 } | 1836 } |
1837 runtime·unlock(&runtime·sched); | 1837 runtime·unlock(&runtime·sched); |
1838 | 1838 |
1839 » runtime·semacquire(&runtime·worldsema); | 1839 » runtime·semacquire(&runtime·worldsema, false); |
1840 m->gcing = 1; | 1840 m->gcing = 1; |
1841 runtime·stoptheworld(); | 1841 runtime·stoptheworld(); |
1842 newprocs = n; | 1842 newprocs = n; |
1843 m->gcing = 0; | 1843 m->gcing = 0; |
1844 runtime·semrelease(&runtime·worldsema); | 1844 runtime·semrelease(&runtime·worldsema); |
1845 runtime·starttheworld(); | 1845 runtime·starttheworld(); |
1846 | 1846 |
1847 return ret; | 1847 return ret; |
1848 } | 1848 } |
1849 | 1849 |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2631 bool | 2631 bool |
2632 runtime·topofstack(Func *f) | 2632 runtime·topofstack(Func *f) |
2633 { | 2633 { |
2634 return f->entry == (uintptr)runtime·goexit || | 2634 return f->entry == (uintptr)runtime·goexit || |
2635 f->entry == (uintptr)runtime·mstart || | 2635 f->entry == (uintptr)runtime·mstart || |
2636 f->entry == (uintptr)runtime·mcall || | 2636 f->entry == (uintptr)runtime·mcall || |
2637 f->entry == (uintptr)runtime·morestack || | 2637 f->entry == (uintptr)runtime·morestack || |
2638 f->entry == (uintptr)runtime·lessstack || | 2638 f->entry == (uintptr)runtime·lessstack || |
2639 f->entry == (uintptr)_rt0_go; | 2639 f->entry == (uintptr)_rt0_go; |
2640 } | 2640 } |
LEFT | RIGHT |