fixes #10584 [backport]
This commit is contained in:
parent
bfb2ad5078
commit
65f3e390e8
1 changed files with 4 additions and 3 deletions
|
|
@ -320,6 +320,10 @@ gSomeReady.initSemaphore()
|
||||||
proc slave(w: ptr Worker) {.thread.} =
|
proc slave(w: ptr Worker) {.thread.} =
|
||||||
isSlave = true
|
isSlave = true
|
||||||
while true:
|
while true:
|
||||||
|
if w.shutdown:
|
||||||
|
w.shutdown = false
|
||||||
|
atomicDec currentPoolSize
|
||||||
|
break
|
||||||
when declared(atomicStoreN):
|
when declared(atomicStoreN):
|
||||||
atomicStoreN(addr(w.ready), true, ATOMIC_SEQ_CST)
|
atomicStoreN(addr(w.ready), true, ATOMIC_SEQ_CST)
|
||||||
else:
|
else:
|
||||||
|
|
@ -340,9 +344,6 @@ proc slave(w: ptr Worker) {.thread.} =
|
||||||
dec numSlavesRunning
|
dec numSlavesRunning
|
||||||
|
|
||||||
if w.q.len != 0: w.cleanFlowVars
|
if w.q.len != 0: w.cleanFlowVars
|
||||||
if w.shutdown:
|
|
||||||
w.shutdown = false
|
|
||||||
atomicDec currentPoolSize
|
|
||||||
|
|
||||||
proc distinguishedSlave(w: ptr Worker) {.thread.} =
|
proc distinguishedSlave(w: ptr Worker) {.thread.} =
|
||||||
while true:
|
while true:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue