From 5999a28de80cf685b037e53c8dc9a511f11fe7b2 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 20 Jul 2022 11:43:30 -0400 Subject: runtime: trivial replacements of _g_ in os files Change-Id: I7886ea6b94697bafb8ea345508c9cb752c92cadc Reviewed-on: https://go-review.googlesource.com/c/go/+/418586 Reviewed-by: Austin Clements TryBot-Result: Gopher Robot Run-TryBot: Michael Pratt --- src/runtime/os_netbsd.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/runtime/os_netbsd.go') 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() } -- cgit v1.2.1