aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 71e80e9cb7..7e177c72cd 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -222,10 +222,10 @@ func main() {
throw("_cgo_pthread_key_created missing")
}
- if _cgo_thread_start == nil {
- throw("_cgo_thread_start missing")
- }
if GOOS != "windows" {
+ if _cgo_thread_start == nil {
+ throw("_cgo_thread_start missing")
+ }
if _cgo_setenv == nil {
throw("_cgo_setenv missing")
}
@@ -2913,11 +2913,8 @@ func newm(fn func(), pp *p, id int64) {
}
func newm1(mp *m) {
- if iscgo {
+ if iscgo && _cgo_thread_start != nil {
var ts cgothreadstart
- if _cgo_thread_start == nil {
- throw("_cgo_thread_start missing")
- }
ts.g.set(mp.g0)
ts.tls = (*uint64)(unsafe.Pointer(&mp.tls[0]))
ts.fn = unsafe.Pointer(abi.FuncPCABI0(mstart))