// BSD interface for threading. void osinit(void) { // Register our thread-creation callback (see {amd64,386}/sys.s) // but only if we're not using cgo. If we are using cgo we need // to let the C pthread libary install its own thread-creation callback. extern void (*libcgo_thread_start)(void*); if(libcgo_thread_start == nil) bsdthread_register(); }
void runtime·goenvs(void) { runtime·goenvs_unix(); // Register our thread-creation callback (see sys_darwin_{amd64,386}.s) // but only if we're not using cgo. If we are using cgo we need // to let the C pthread libary install its own thread-creation callback. if(!runtime·iscgo) { if(runtime·bsdthread_register() != 0) { if(runtime·getenv("DYLD_INSERT_LIBRARIES")) runtime·throw("runtime: bsdthread_register error (unset DYLD_INSERT_LIBRARIES)"); runtime·throw("runtime: bsdthread_register error"); } } }