File tree Expand file tree Collapse file tree 2 files changed +1
-9
lines changed Expand file tree Collapse file tree 2 files changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -143,12 +143,5 @@ void Intersection::processVehicleQueue()
143143bool Intersection::trafficLightIsGreen ()
144144{
145145 // please include this part once you have solved the final project tasks
146- /*
147- if (_trafficLight.getCurrentPhase() == TrafficLightPhase::green)
148- return true;
149- else
150- return false;
151- */
152-
153- return true ; // makes traffic light permanently green
146+ return _trafficLight.getCurrentPhase () == TrafficLightPhase::green;
154147}
Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ void TrafficLight::simulate()
6565}
6666
6767void TrafficLight::toggleCurrentPhase () {
68- std::lock_guard<std::mutex> lock (_currentPhase_mtx); // write is synchronized
6968 _currentPhase = _currentPhase == TrafficLightPhase::red ? TrafficLightPhase::green : TrafficLightPhase::red;
7069 _messages.send (std::move (_currentPhase));
7170}
You can’t perform that action at this time.
0 commit comments