Skip to content

Commit 8b3e647

Browse files
authored
Update traffic-light-controlled-intersection.py
1 parent bbb702d commit 8b3e647

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/traffic-light-controlled-intersection.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class TrafficLight(object):
88

99
def __init__(self):
10-
self.__lock = threading.Lock()
10+
self.__l = threading.Lock()
1111
self.__light = 1
1212

1313
def carArrived(self, carId, roadId, direction, turnGreen, crossCar):
@@ -19,7 +19,7 @@ def carArrived(self, carId, roadId, direction, turnGreen, crossCar):
1919
:type crossCar: method --> // Use crossCar() to make car cross the intersection
2020
:rtype: void
2121
"""
22-
with self.__lock:
22+
with self.__l:
2323
if self.__light != roadId:
2424
self.__light = roadId
2525
turnGreen()

0 commit comments

Comments
 (0)