Use core.cpuid.threadsPerCPU to determine the number of worker threads.

Question is if this needs to be multiplied by the number of CPUs on multi-CPU systems...
Reimplemented TaskMutex for proper thread-safety and increased performance in situations without contention.