]> Cypherpunks repositories - gostls13.git/commit
runtime: use semaphore structure for futex locks
authorRhys Hiltner <rhys.hiltner@gmail.com>
Tue, 14 May 2024 19:37:14 +0000 (12:37 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 21 May 2024 17:17:28 +0000 (17:17 +0000)
commitdfb7073bb8e66630156fc14ae50042acef89a929
tree4c9314366706f3cc1ba26b45ab2672592a5adb88
parentbe0b569caa0eab1a7f30edf64e550bbf5f6ff235
runtime: use semaphore structure for futex locks

Prepare the futex-based implementation of lock2 to maintain a list of
waiting Ms. Beyond storing an muintptr in the mutex's key field, we now
must never overwrite that field (even for a moment) without taking its
current value into account.

The semaphore-based implementation of lock2 already has that behavior.
Reuse that structure.

For #66999

Change-Id: I23b6f6bacb276fe33c6aed5c0571161a7e71fe6c
Reviewed-on: https://go-review.googlesource.com/c/go/+/585636
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/lock_futex.go