Remove critical region, replace with num_thread sized array.