Fixed deadlocks and prevented car_num race condition.