aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2024-04-04 04:50:13 +0000
committerGopher Robot <gobot@golang.org>2024-04-18 21:25:11 +0000
commitdfc86e922cd033155339c22aff64e109f6c8cc89 (patch)
treede0ed468258f04af1eaa6b60c16a13dd4698347e /src/runtime/proc.go
parentfa470f6245191b3c2f0b715194edf7cdf951af48 (diff)
downloadgo-dfc86e922cd033155339c22aff64e109f6c8cc89.tar.xz
internal/weak: add package implementing weak pointers
This change adds the internal/weak package, which exposes GC-supported weak pointers to the standard library. This is for the upcoming weak package, but may be useful for other future constructs. For #62483. Change-Id: I4aa8fa9400110ad5ea022a43c094051699ccab9d Reviewed-on: https://go-review.googlesource.com/c/go/+/576297 Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index a029a23f7d..8f5787dbbb 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -6937,6 +6937,18 @@ func sync_atomic_runtime_procUnpin() {
procUnpin()
}
+//go:linkname internal_weak_runtime_procPin internal/weak.runtime_procPin
+//go:nosplit
+func internal_weak_runtime_procPin() int {
+ return procPin()
+}
+
+//go:linkname internal_weak_runtime_procUnpin internal/weak.runtime_procUnpin
+//go:nosplit
+func internal_weak_runtime_procUnpin() {
+ procUnpin()
+}
+
// Active spinning for sync.Mutex.
//
//go:linkname sync_runtime_canSpin sync.runtime_canSpin