diff --git a/lib/pure/concurrency/threadpool.nim b/lib/pure/concurrency/threadpool.nim index cf4f585883..9e19e47b57 100644 --- a/lib/pure/concurrency/threadpool.nim +++ b/lib/pure/concurrency/threadpool.nim @@ -526,10 +526,12 @@ proc nimSpawn4(fn: WorkerProc; data: pointer; id: ThreadId) {.compilerProc.} = if selectWorker(addr(distinguishedData[id]), fn, data): break await(distinguishedData[id].readyForTask) +template spawnInAllThreads(e: untyped) = + ## Spawn `e` on all of the threadpool threads. + for i in 0 ..