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_openbsd.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/runtime/os_openbsd.go') diff --git a/src/runtime/os_openbsd.go b/src/runtime/os_openbsd.go index 2383dc8428..d43414459d 100644 --- a/src/runtime/os_openbsd.go +++ b/src/runtime/os_openbsd.go @@ -84,7 +84,7 @@ func semacreate(mp *m) { //go:nosplit func semasleep(ns int64) int32 { - _g_ := getg() + gp := getg() // Compute sleep deadline. var tsp *timespec @@ -95,9 +95,9 @@ func semasleep(ns int64) int32 { } 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 @@ -110,7 +110,7 @@ func semasleep(ns int64) int32 { // be examined [...] immediately before blocking. If that int // is non-zero then __thrsleep() will immediately return EINTR // without blocking." - ret := thrsleep(uintptr(unsafe.Pointer(&_g_.m.waitsemacount)), _CLOCK_MONOTONIC, tsp, 0, &_g_.m.waitsemacount) + ret := thrsleep(uintptr(unsafe.Pointer(&gp.m.waitsemacount)), _CLOCK_MONOTONIC, tsp, 0, &gp.m.waitsemacount) if ret == _EWOULDBLOCK { return -1 } -- cgit v1.2.1