Creates a thread-pool.
Destroys a thread-pool.
Calls the delegate in parallel, with 0..count as index. Immediate waiting for completion. If there is only one task, it is run directly on this thread. IMPORTANT to be reentrant there! widget drawn alone can then launch same threadpool.
Same, but does not wait for completion. You cannot have 2 concurrent parallelFor for the same thread-pool.
Wait for completion of the previous parallelFor, if any.
Rewrite of the ThreadPool using condition variables. FUTURE: this could be speed-up by using futures. Description of the task and associated condition+mutex would go in an external struct. Note: the interface of the thread-pool itself is not thread-safe, you cannot give orders from multiple threads at once.