aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/os1_windows.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/runtime/os1_windows.go b/src/runtime/os1_windows.go
index 561d3ce457..4ae1a8411b 100644
--- a/src/runtime/os1_windows.go
+++ b/src/runtime/os1_windows.go
@@ -359,6 +359,8 @@ func nanotime() int64 {
}
// Calling stdcall on os stack.
+// May run during STW, so write barriers are not allowed.
+//go:nowritebarrier
//go:nosplit
func stdcall(fn stdFunction) uintptr {
gp := getg()
@@ -367,7 +369,8 @@ func stdcall(fn stdFunction) uintptr {
if mp.profilehz != 0 {
// leave pc/sp for cpu profiler
- mp.libcallg = gp
+ // gp is on allg, so this WB can be eliminated.
+ setGNoWriteBarrier(&mp.libcallg, gp)
mp.libcallpc = getcallerpc(unsafe.Pointer(&fn))
// sp must be the last, because once async cpu profiler finds
// all three values to be non-zero, it will use them