aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/os2_aix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/os2_aix.go')
-rw-r--r--src/runtime/os2_aix.go42
1 files changed, 18 insertions, 24 deletions
diff --git a/src/runtime/os2_aix.go b/src/runtime/os2_aix.go
index abd1010be9..4d77f0de6d 100644
--- a/src/runtime/os2_aix.go
+++ b/src/runtime/os2_aix.go
@@ -527,20 +527,17 @@ func internal_cpu_getsystemcfg(label uint) uint {
func usleep1(us uint32)
//go:nosplit
-func usleep(us uint32) {
- _g_ := getg()
+func usleep_no_g(us uint32) {
+ usleep1(us)
+}
- // Check the validity of m because we might be called in cgo callback
- // path early enough where there isn't a g or a m available yet.
- if _g_ != nil && _g_.m != nil {
- r, err := syscall1(&libc_usleep, uintptr(us))
- if int32(r) == -1 {
- println("syscall usleep failed: ", hex(err))
- throw("syscall usleep")
- }
- return
+//go:nosplit
+func usleep(us uint32) {
+ r, err := syscall1(&libc_usleep, uintptr(us))
+ if int32(r) == -1 {
+ println("syscall usleep failed: ", hex(err))
+ throw("syscall usleep")
}
- usleep1(us)
}
//go:nosplit
@@ -611,20 +608,17 @@ func raiseproc(sig uint32) {
func osyield1()
//go:nosplit
-func osyield() {
- _g_ := getg()
+func osyield_no_g() {
+ osyield1()
+}
- // Check the validity of m because it might be called during a cgo
- // callback early enough where m isn't available yet.
- if _g_ != nil && _g_.m != nil {
- r, err := syscall0(&libc_sched_yield)
- if int32(r) == -1 {
- println("syscall osyield failed: ", hex(err))
- throw("syscall osyield")
- }
- return
+//go:nosplit
+func osyield() {
+ r, err := syscall0(&libc_sched_yield)
+ if int32(r) == -1 {
+ println("syscall osyield failed: ", hex(err))
+ throw("syscall osyield")
}
- osyield1()
}
//go:nosplit