Tests code used to run tasks concurrently in multiple threads.