View source code
Display the source code in std/parallelism.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Function std.parallelism.TaskPool.finish

Signals worker threads to terminate when the queue becomes empty.

void finish (
  bool blocking = false
) @trusted;

If blocking argument is true, wait for all worker threads to terminate before returning. This option might be used in applications where task results are never consumed-- e.g. when TaskPool is employed as a rudimentary scheduler for tasks which communicate by means other than return values.


Calling this function with blocking = true from a worker thread that is a member of the same TaskPool that finish is being called on will result in a deadlock.



Boost License 1.0