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.h" | 6 #include "arch.h" |
7 #include "defs.h" | 7 #include "defs.h" |
8 #include "malloc.h" | 8 #include "malloc.h" |
9 #include "os.h" | 9 #include "os.h" |
10 #include "stack.h" | 10 #include "stack.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 int32 msyscall; // number of ms in system calls | 70 int32 msyscall; // number of ms in system calls |
71 | 71 |
72 int32 predawn; // running initialization, don't run new gs. | 72 int32 predawn; // running initialization, don't run new gs. |
73 int32 profilehz; // cpu profiling rate | 73 int32 profilehz; // cpu profiling rate |
74 | 74 |
75 Note stopped; // one g can wait here for ms to stop | 75 Note stopped; // one g can wait here for ms to stop |
76 int32 waitstop; // after setting this flag | 76 int32 waitstop; // after setting this flag |
77 }; | 77 }; |
78 | 78 |
79 Sched runtime·sched; | 79 Sched runtime·sched; |
80 int32 gomaxprocs; | 80 int32 runtime·gomaxprocs; |
81 | 81 |
82 // An m that is waiting for notewakeup(&m->havenextg). This may be | 82 // An m that is waiting for notewakeup(&m->havenextg). This may be |
83 // only be accessed while the scheduler lock is held. This is used to | 83 // only be accessed while the scheduler lock is held. This is used to |
84 // minimize the number of times we call notewakeup while the scheduler | 84 // minimize the number of times we call notewakeup while the scheduler |
85 // lock is held, since the m will normally move quickly to lock the | 85 // lock is held, since the m will normally move quickly to lock the |
86 // scheduler itself, producing lock contention. | 86 // scheduler itself, producing lock contention. |
87 static M* mwakeup; | 87 static M* mwakeup; |
88 | 88 |
89 // Scheduling helpers. Sched must be locked. | 89 // Scheduling helpers. Sched must be locked. |
90 static void gput(G*); // put/get on ghead/gtail | 90 static void gput(G*); // put/get on ghead/gtail |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 arg[0][k.len] = 0; | 1359 arg[0][k.len] = 0; |
1360 | 1360 |
1361 arg[1] = runtime·malloc(v.len + 1); | 1361 arg[1] = runtime·malloc(v.len + 1); |
1362 runtime·mcpy(arg[1], v.str, v.len); | 1362 runtime·mcpy(arg[1], v.str, v.len); |
1363 arg[1][v.len] = 0; | 1363 arg[1][v.len] = 0; |
1364 | 1364 |
1365 runtime·asmcgocall(libcgo_setenv, arg); | 1365 runtime·asmcgocall(libcgo_setenv, arg); |
1366 runtime·free(arg[0]); | 1366 runtime·free(arg[0]); |
1367 runtime·free(arg[1]); | 1367 runtime·free(arg[1]); |
1368 } | 1368 } |
LEFT | RIGHT |