summaryrefslogtreecommitdiffhomepage
path: root/pkg/sync/goyield_unsafe.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-12-02 19:06:41 -0800
committergVisor bot <gvisor-bot@google.com>2020-12-02 19:08:32 -0800
commited8bdf461b5f8093957a11f526032d42938af7ca (patch)
treeabb6be971535360397634f568d26c60a4696c0c1 /pkg/sync/goyield_unsafe.go
parentbdaae08ee2b4834422d46cdfd292161e974e4d26 (diff)
Consolidate most synchronization primitive linknames in the sync package.
PiperOrigin-RevId: 345359823
Diffstat (limited to 'pkg/sync/goyield_unsafe.go')
-rw-r--r--pkg/sync/goyield_unsafe.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/sync/goyield_unsafe.go b/pkg/sync/goyield_unsafe.go
new file mode 100644
index 000000000..672ee274d
--- /dev/null
+++ b/pkg/sync/goyield_unsafe.go
@@ -0,0 +1,18 @@
+// Copyright 2020 The gVisor Authors.
+//
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build go1.14
+// +build !go1.17
+
+// Check go:linkname function signatures when updating Go version.
+
+package sync
+
+import (
+ _ "unsafe" // for go:linkname
+)
+
+//go:linkname goyield runtime.goyield
+func goyield()