mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 10:43:29 +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.
|
// other cores when ready.
|
||||||
func run() {
|
func run() {
|
||||||
initHeap()
|
initHeap()
|
||||||
|
initRand()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
// Package initializers are currently run single-threaded.
|
// Package initializers are currently run single-threaded.
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ var (
|
|||||||
// can just initialize everything and run main.main on the main thread.
|
// can just initialize everything and run main.main on the main thread.
|
||||||
func run() {
|
func run() {
|
||||||
initHeap()
|
initHeap()
|
||||||
|
initRand()
|
||||||
task.Init(stackTop)
|
task.Init(stackTop)
|
||||||
initAll()
|
initAll()
|
||||||
callMain()
|
callMain()
|
||||||
|
|||||||
Reference in New Issue
Block a user