Skip to content

Commit a1de93b

Browse files
deadprogramburgrp
authored andcommitted
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>
1 parent 0b003cf commit a1de93b

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/runtime/scheduler_cores.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ func sleep(duration int64) {
136136
// other cores when ready.
137137
func run() {
138138
initHeap()
139+
initRand()
139140

140141
go func() {
141142
// Package initializers are currently run single-threaded.

src/runtime/scheduler_threads.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var (
2222
// can just initialize everything and run main.main on the main thread.
2323
func run() {
2424
initHeap()
25+
initRand()
2526
task.Init(stackTop)
2627
initAll()
2728
callMain()

0 commit comments

Comments
 (0)