aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorRhys Hiltner <rhys.hiltner@gmail.com>2024-10-28 14:01:54 -0700
committerMichael Knyszek <mknyszek@google.com>2024-11-15 21:15:59 +0000
commit18c2461af38e93ed385e953f3336fcaaca2da727 (patch)
treeca2437f778f0d63947692e38936c3708b416ec8b /src/runtime/runtime2.go
parent252e9def65cd6230447fc11046d7f4b176ae2d4b (diff)
downloadgo-18c2461af38e93ed385e953f3336fcaaca2da727.tar.xz
runtime: allow futex OSes to use sema-based mutex
Implement sema{create,sleep,wakeup} in terms of the futex syscall when available. Split the lock2/unlock2 implementations out of lock_sema.go and lock_futex.go (which they shared with runtime.note) to allow swapping in new implementations of those. Let futex-based platforms use the semaphore-based mutex implementation. Control that via the new "spinbitmutex" GOEXPERMENT value, disabled by default. This lays the groundwork for a "spinbit" mutex implementation; it does not include the new mutex implementation. For #68578. Change-Id: I091289c85124212a87abec7079ecbd9e610b4270 Reviewed-on: https://go-review.googlesource.com/c/go/+/622996 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index 2d668637b1..b8c710a816 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -571,7 +571,7 @@ type m struct {
createstack [32]uintptr // stack that created this thread, it's used for StackRecord.Stack0, so it must align with it.
lockedExt uint32 // tracking for external LockOSThread
lockedInt uint32 // tracking for internal lockOSThread
- nextwaitm muintptr // next m waiting for lock
+ mWaitList mWaitList // list of runtime lock waiters
mLockProfile mLockProfile // fields relating to runtime.lock contention
profStack []uintptr // used for memory/block/mutex stack traces