summary refs log tree commit diff stats
path: root/lib/pure/concurrency
diff options
context:
space:
mode:
authorYuriy Glukhov <yglukhov@users.noreply.github.com>2017-07-17 14:45:54 +0300
committerAndreas Rumpf <rumpf_a@web.de>2017-07-17 13:45:54 +0200
commit30e2af969cb2373b01ec585979db73577a613f93 (patch)
tree3492057144c8067c5da5325d832b268b687d7704 /lib/pure/concurrency
parent733272d55ddf03ecbe4ad4a73c4f143df182a14b (diff)
downloadNim-30e2af969cb2373b01ec585979db73577a613f93.tar.gz
Revert "GC_fullCollect on sync threadpool (#6107)" (#6119)
This reverts commit bdb653c4156af099814df2e21b9878cdb1591190.
Diffstat (limited to 'lib/pure/concurrency')
-rw-r--r--lib/pure/concurrency/threadpool.nim16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/pure/concurrency/threadpool.nim b/lib/pure/concurrency/threadpool.nim
index 9e19e47b5..cf4f58588 100644
--- a/lib/pure/concurrency/threadpool.nim
+++ b/lib/pure/concurrency/threadpool.nim
@@ -526,12 +526,10 @@ 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 .. <currentPoolSize:
-    pinnedSpawn(i, e)
 
-proc syncAux() {.inline.} =
+proc sync*() =
+  ## a simple barrier to wait for all spawn'ed tasks. If you need more elaborate
+  ## waiting, you have to use an explicit barrier.
   var toRelease = 0
   while true:
     var allReady = true
@@ -545,12 +543,4 @@ proc syncAux() {.inline.} =
   for i in 0 ..< toRelease:
     signal(gSomeReady)
 
-proc sync*(cleanup: bool = true) =
-  ## A simple barrier to wait for all spawn'ed tasks. Calls `GC_fullCollect()`
-  ## on all threads if `cleanup` is `true`. If you need more elaborate
-  ## waiting, you have to use an explicit barrier.
-  syncAux()
-  if cleanup:
-    spawnInAllThreads GC_fullCollect()
-
 setup()