diff options
author | Joel Sing <joel@sing.id.au> | 2020-08-24 03:13:54 +1000 |
---|---|---|
committer | Joel Sing <joel@sing.id.au> | 2021-01-19 12:49:13 +0000 |
commit | d047c91a6c0f22af00d1c1e770a9d85201392656 (patch) | |
tree | dcd9610ea13b12d5490960e2023a8b237de9d27a /src/runtime/sys_darwin.go | |
parent | 61debffd977889cd3f7f63b4f71d5a8ef1fc604e (diff) | |
download | go-d047c91a6c0f22af00d1c1e770a9d85201392656.tar.gz go-d047c91a6c0f22af00d1c1e770a9d85201392656.zip |
cmd/link,runtime: switch openbsd/amd64 to pthreads
This switches openbsd/amd64 to thread creation via pthreads, rather than doing
direct system calls.
Update #36435
Change-Id: I1105d5c392aa3e4c445d99c8cb80b927712e3529
Reviewed-on: https://go-review.googlesource.com/c/go/+/250180
Trust: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/sys_darwin.go')
-rw-r--r-- | src/runtime/sys_darwin.go | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/runtime/sys_darwin.go b/src/runtime/sys_darwin.go index 55845bf2e5..4a3f2fc453 100644 --- a/src/runtime/sys_darwin.go +++ b/src/runtime/sys_darwin.go @@ -6,50 +6,6 @@ package runtime import "unsafe" -// Call fn with arg as its argument. Return what fn returns. -// fn is the raw pc value of the entry point of the desired function. -// Switches to the system stack, if not already there. -// Preserves the calling point as the location where a profiler traceback will begin. -//go:nosplit -func libcCall(fn, arg unsafe.Pointer) int32 { - // Leave caller's PC/SP/G around for traceback. - gp := getg() - var mp *m - if gp != nil { - mp = gp.m - } - if mp != nil && mp.libcallsp == 0 { - mp.libcallg.set(gp) - mp.libcallpc = getcallerpc() - // sp must be the last, because once async cpu profiler finds - // all three values to be non-zero, it will use them - mp.libcallsp = getcallersp() - } else { - // Make sure we don't reset libcallsp. This makes - // libcCall reentrant; We remember the g/pc/sp for the - // first call on an M, until that libcCall instance - // returns. Reentrance only matters for signals, as - // libc never calls back into Go. The tricky case is - // where we call libcX from an M and record g/pc/sp. - // Before that call returns, a signal arrives on the - // same M and the signal handling code calls another - // libc function. We don't want that second libcCall - // from within the handler to be recorded, and we - // don't want that call's completion to zero - // libcallsp. - // We don't need to set libcall* while we're in a sighandler - // (even if we're not currently in libc) because we block all - // signals while we're handling a signal. That includes the - // profile signal, which is the one that uses the libcall* info. - mp = nil - } - res := asmcgocall(fn, arg) - if mp != nil { - mp.libcallsp = 0 - } - return res -} - // The X versions of syscall expect the libc call to return a 64-bit result. // Otherwise (the non-X version) expects a 32-bit result. // This distinction is required because an error is indicated by returning -1, |