mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
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).
This commit is contained in:
@@ -20,6 +20,10 @@ package interrupt
|
|||||||
// if c.Saved() {
|
// if c.Saved() {
|
||||||
// c.Jump()
|
// 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 {
|
type Checkpoint struct {
|
||||||
jumpSP uintptr
|
jumpSP uintptr
|
||||||
jumpPC uintptr
|
jumpPC uintptr
|
||||||
|
|||||||
Reference in New Issue
Block a user