From 7a5a50d949880b34d6fc882bfdc7caed890c40fa Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 25 May 2026 17:50:08 +0200 Subject: [PATCH] runntime/interrupt.Checkpoint: add warning that this is hard to use Realized this while looking through the code: there is no way to use this safely when the scheduler is involved. It can only be used safely with a `wfe` or similar (part of scheduler code). --- src/runtime/interrupt/checkpoint.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/interrupt/checkpoint.go b/src/runtime/interrupt/checkpoint.go index f02a2bead..4cb622f3e 100644 --- a/src/runtime/interrupt/checkpoint.go +++ b/src/runtime/interrupt/checkpoint.go @@ -20,6 +20,10 @@ package interrupt // if c.Saved() { // c.Jump() // } +// +// Warning: only use this in special runtime code! If it is used from a normal +// goroutine, and the scheduler switches to a different goroutine, havoc will +// ensure. type Checkpoint struct { jumpSP uintptr jumpPC uintptr