fix race in runWorker
This commit is contained in:
parent
bf315e63d7
commit
908d47305b
3
sched.go
3
sched.go
@ -367,7 +367,10 @@ func (sh *scheduler) trySched() {
|
|||||||
|
|
||||||
func (sh *scheduler) runWorker(wid WorkerID) {
|
func (sh *scheduler) runWorker(wid WorkerID) {
|
||||||
go func() {
|
go func() {
|
||||||
|
sh.workersLk.Lock()
|
||||||
worker := sh.workers[wid]
|
worker := sh.workers[wid]
|
||||||
|
sh.workersLk.Unlock()
|
||||||
|
|
||||||
scheduledWindows := make(chan *schedWindow, SchedWindows)
|
scheduledWindows := make(chan *schedWindow, SchedWindows)
|
||||||
taskDone := make(chan struct{}, 1)
|
taskDone := make(chan struct{}, 1)
|
||||||
windowsRequested := 0
|
windowsRequested := 0
|
||||||
|
Loading…
Reference in New Issue
Block a user