summaryrefslogtreecommitdiff
path: root/src/runtime/os_netbsd.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/os_netbsd.go')
-rw-r--r--src/runtime/os_netbsd.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/runtime/os_netbsd.go b/src/runtime/os_netbsd.go
index 3cbace38f9..bb23adff07 100644
--- a/src/runtime/os_netbsd.go
+++ b/src/runtime/os_netbsd.go
@@ -152,16 +152,16 @@ func semacreate(mp *m) {
//go:nosplit
func semasleep(ns int64) int32 {
- _g_ := getg()
+ gp := getg()
var deadline int64
if ns >= 0 {
deadline = nanotime() + ns
}
for {
- v := atomic.Load(&_g_.m.waitsemacount)
+ v := atomic.Load(&gp.m.waitsemacount)
if v > 0 {
- if atomic.Cas(&_g_.m.waitsemacount, v, v-1) {
+ if atomic.Cas(&gp.m.waitsemacount, v, v-1) {
return 0 // semaphore acquired
}
continue
@@ -178,7 +178,7 @@ func semasleep(ns int64) int32 {
ts.setNsec(wait)
tsp = &ts
}
- ret := lwp_park(_CLOCK_MONOTONIC, _TIMER_RELTIME, tsp, 0, unsafe.Pointer(&_g_.m.waitsemacount), nil)
+ ret := lwp_park(_CLOCK_MONOTONIC, _TIMER_RELTIME, tsp, 0, unsafe.Pointer(&gp.m.waitsemacount), nil)
if ret == _ETIMEDOUT {
return -1
}
@@ -289,8 +289,8 @@ func mpreinit(mp *m) {
// Called to initialize a new m (including the bootstrap m).
// Called on the new thread, cannot allocate memory.
func minit() {
- _g_ := getg()
- _g_.m.procid = uint64(lwp_self())
+ gp := getg()
+ gp.m.procid = uint64(lwp_self())
// On NetBSD a thread created by pthread_create inherits the
// signal stack of the creating thread. We always create a
@@ -299,8 +299,8 @@ func minit() {
// created in C that calls sigaltstack and then calls a Go
// function, because we will lose track of the C code's
// sigaltstack, but it's the best we can do.
- signalstack(&_g_.m.gsignal.stack)
- _g_.m.newSigstack = true
+ signalstack(&gp.m.gsignal.stack)
+ gp.m.newSigstack = true
minitSignalMask()
}