Fix a race-condition in TaskPool.
The lock that should surround the foreach loop was given up prematurely.
This commit is contained in:
parent
eb046e2295
commit
7703cc675f
|
@ -220,10 +220,13 @@ shared final class TaskPool {
|
||||||
static assert(areConvertibleTo!(Group!ARGS, Group!FARGS),
|
static assert(areConvertibleTo!(Group!ARGS, Group!FARGS),
|
||||||
"Cannot convert arguments '"~ARGS.stringof~"' to function arguments '"~FARGS.stringof~"'.");
|
"Cannot convert arguments '"~ARGS.stringof~"' to function arguments '"~FARGS.stringof~"'.");
|
||||||
|
|
||||||
foreach (thr; m_state.lock.threads) {
|
{
|
||||||
|
auto st = m_state.lock;
|
||||||
|
foreach (thr; st.threads) {
|
||||||
// create one TFI per thread to properly account for elaborate assignment operators/postblit
|
// create one TFI per thread to properly account for elaborate assignment operators/postblit
|
||||||
thr.m_queue.put(callable, args);
|
thr.m_queue.put(callable, args);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_signal.emit();
|
m_signal.emit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue