OLD | NEW |
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 "type.h" | 6 #include "type.h" |
7 #include "defs_GOOS_GOARCH.h" | 7 #include "defs_GOOS_GOARCH.h" |
8 #include "os_GOOS.h" | 8 #include "os_GOOS.h" |
9 | 9 |
10 #pragma dynimport runtime·CloseHandle CloseHandle "kernel32.dll" | 10 #pragma dynimport runtime·CloseHandle CloseHandle "kernel32.dll" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 nil, (uintptr)0x20000, runtime·tstart_stdcall, mp, | 199 nil, (uintptr)0x20000, runtime·tstart_stdcall, mp, |
200 STACK_SIZE_PARAM_IS_A_RESERVATION, nil); | 200 STACK_SIZE_PARAM_IS_A_RESERVATION, nil); |
201 if(thandle == nil) { | 201 if(thandle == nil) { |
202 runtime·printf("runtime: failed to create new OS thread (have %d
already; errno=%d)\n", runtime·mcount(), runtime·getlasterror()); | 202 runtime·printf("runtime: failed to create new OS thread (have %d
already; errno=%d)\n", runtime·mcount(), runtime·getlasterror()); |
203 runtime·throw("runtime.newosproc"); | 203 runtime·throw("runtime.newosproc"); |
204 } | 204 } |
205 runtime·atomicstorep(&mp->thread, thandle); | 205 runtime·atomicstorep(&mp->thread, thandle); |
206 } | 206 } |
207 | 207 |
208 // Called to initialize a new m (including the bootstrap m). | 208 // Called to initialize a new m (including the bootstrap m). |
| 209 // Called on the parent thread (main thread in case of bootstrap), can allocate
memory. |
| 210 void |
| 211 runtime·mpreinit(M *mp) |
| 212 { |
| 213 USED(mp); |
| 214 } |
| 215 |
| 216 // Called to initialize a new m (including the bootstrap m). |
| 217 // Called on the new thread, can not allocate memory. |
209 void | 218 void |
210 runtime·minit(void) | 219 runtime·minit(void) |
211 { | 220 { |
212 runtime·install_exception_handler(); | 221 runtime·install_exception_handler(); |
213 } | 222 } |
214 | 223 |
215 // Called from dropm to undo the effect of an minit. | 224 // Called from dropm to undo the effect of an minit. |
216 void | 225 void |
217 runtime·unminit(void) | 226 runtime·unminit(void) |
218 { | 227 { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 runtime·setprof(bool on) | 439 runtime·setprof(bool on) |
431 { | 440 { |
432 USED(on); | 441 USED(on); |
433 } | 442 } |
434 | 443 |
435 int8 runtime·badcallbackmsg[] = "runtime: cgo callback on thread not created by
Go.\n"; | 444 int8 runtime·badcallbackmsg[] = "runtime: cgo callback on thread not created by
Go.\n"; |
436 int32 runtime·badcallbacklen = sizeof runtime·badcallbackmsg - 1; | 445 int32 runtime·badcallbacklen = sizeof runtime·badcallbackmsg - 1; |
437 | 446 |
438 int8 runtime·badsignalmsg[] = "runtime: signal received on thread not created by
Go.\n"; | 447 int8 runtime·badsignalmsg[] = "runtime: signal received on thread not created by
Go.\n"; |
439 int32 runtime·badsignallen = sizeof runtime·badsignalmsg - 1; | 448 int32 runtime·badsignallen = sizeof runtime·badsignalmsg - 1; |
OLD | NEW |