mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 11:13:27 +00:00
runtime: make Goexit exit host threads
The threads scheduler handled runtime.Goexit using the generic deadlock path, which parked the current pthread forever. Add a scheduler-specific goexit hook so it can remove the current task and exit the pthread while ordinary blocking deadlocks still block. Track main goroutine Goexit so the last remaining goroutine reports the expected deadlock instead of letting the process exit successfully. Expand the crash coverage with the Goexit cases covered by Big Go's runtime tests.
This commit is contained in:
@@ -32,6 +32,10 @@ func deadlock() {
|
||||
trap()
|
||||
}
|
||||
|
||||
func goexit() {
|
||||
task.Exit()
|
||||
}
|
||||
|
||||
// Mark the given task as ready to resume.
|
||||
// This is allowed even if the task isn't paused yet, but will pause soon.
|
||||
func scheduleTask(t *task.Task) {
|
||||
|
||||
Reference in New Issue
Block a user