mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 02:57:46 +00:00
runtime: add calls to initRand() during run() for all schedulers.
Intended to ensure that the random number seed used is always initialized on startup. Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -136,6 +136,7 @@ func sleep(duration int64) {
|
||||
// other cores when ready.
|
||||
func run() {
|
||||
initHeap()
|
||||
initRand()
|
||||
|
||||
go func() {
|
||||
// Package initializers are currently run single-threaded.
|
||||
|
||||
@@ -22,6 +22,7 @@ var (
|
||||
// can just initialize everything and run main.main on the main thread.
|
||||
func run() {
|
||||
initHeap()
|
||||
initRand()
|
||||
task.Init(stackTop)
|
||||
initAll()
|
||||
callMain()
|
||||
|
||||
Reference in New Issue
Block a user