Threads and thread-pool.
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.
Launch a function in a newly created thread, which is destroyed afterwards. Return the thread so that you can call .join() on it.
Optimistic thread, failure not supported