import "unsafe"
+func close(fd int32) int32
+
+//go:noescape
+func open(name *byte, mode, perm int32) int32
+
//go:noescape
func pread(fd int32, buf unsafe.Pointer, nbytes int32, offset int64) int32
maxstacksize = 250000000
}
- systemstack(newsysmon)
+ systemstack(func() {
+ newm(sysmon, nil)
+ })
// Lock the main goroutine onto this, the main OS thread,
// during initialization. Most programs won't care, but a few
}
}
-func newsysmon() {
- _newm(sysmon, nil)
-}
-
func dumpgstatus(gp *g) {
_g_ := getg()
print("runtime: gp: gp=", gp, ", goid=", gp.goid, ", gp->atomicstatus=", readgstatus(gp), "\n")
notewakeup(&mp.park)
} else {
// Start M to run P. Do not start another M below.
- _newm(nil, p)
+ newm(nil, p)
add = false
}
}
// coordinate. This lazy approach works out in practice:
// we don't mind if the first couple gc rounds don't have quite
// the maximum number of procs.
- _newm(mhelpgc, nil)
+ newm(mhelpgc, nil)
}
_g_.m.locks--
if _g_.m.locks == 0 && _g_.preempt { // restore the preemption request in case we've cleared it in newstack
}
// Create a new m. It will start off with a call to fn, or else the scheduler.
-func _newm(fn func(), _p_ *p) {
+func newm(fn func(), _p_ *p) {
mp := allocm(_p_)
mp.nextp = _p_
mp.mstartfn = *(*unsafe.Pointer)(unsafe.Pointer(&fn))
if spinning {
fn = mspinning
}
- _newm(fn, _p_)
+ newm(fn, _p_)
return
}
if mp.spinning {
}
mp := mget()
if mp == nil {
- _newm(nil, _p_)
+ newm(nil, _p_)
} else {
mp.nextp = _p_
notewakeup(&mp.park)
+++ /dev/null
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build plan9
-
-package runtime
-
-func close(fd int32) int32
-
-//go:noescape
-func open(name *byte, mode, perm int32) int32