mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
runtime: move mainExited boolean
This variable is only necessary on the cooperative and none scheduler. It is not used on the threads scheduler. The reason for moving is that the upcoming multicore baremetal scheduler also needs mainExited but of a different type: an atomic variable instead of a plain boolean.
This commit is contained in:
committed by
Ron Evans
parent
95ee572b4d
commit
3f8a110e4a
@@ -4,8 +4,6 @@ import "internal/task"
|
||||
|
||||
const schedulerDebug = false
|
||||
|
||||
var mainExited bool
|
||||
|
||||
var timerQueue *timerNode
|
||||
|
||||
// Simple logging, for debugging.
|
||||
|
||||
@@ -27,6 +27,9 @@ const hasScheduler = true
|
||||
// concurrency, it does not have parallelism.
|
||||
const hasParallelism = false
|
||||
|
||||
// Set to true after main.main returns.
|
||||
var mainExited bool
|
||||
|
||||
// Queues used by the scheduler.
|
||||
var (
|
||||
runqueue task.Queue
|
||||
|
||||
@@ -9,6 +9,9 @@ const hasScheduler = false
|
||||
// No goroutines are allowed, so there's no parallelism anywhere.
|
||||
const hasParallelism = false
|
||||
|
||||
// Set to true after main.main returns.
|
||||
var mainExited bool
|
||||
|
||||
// run is called by the program entry point to execute the go program.
|
||||
// With the "none" scheduler, init and the main function are invoked directly.
|
||||
func run() {
|
||||
|
||||
Reference in New Issue
Block a user