mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
internal/task: swap stack chain when switching goroutines
This change swaps the stack chain when switching goroutines, ensuring that the chain is maintained consistently. This is only really currently necessary with asyncify on wasm.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//go:build scheduler.tasks
|
||||
// +build scheduler.tasks
|
||||
|
||||
package task
|
||||
@@ -54,7 +55,9 @@ func pause() {
|
||||
// This may only be called from the scheduler.
|
||||
func (t *Task) Resume() {
|
||||
currentTask = t
|
||||
t.gcData.swap()
|
||||
t.state.resume()
|
||||
t.gcData.swap()
|
||||
currentTask = nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user