Shaky implementation of a threaded pool of workers for executing tasks added to a queue.