Skip to content

Commit 7efb1e8

Browse files
author
benjamin.peterson
committed
use True and False
git-svn-id: http://svn.python.org/projects/python/trunk@69039 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 5dad751 commit 7efb1e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/mutex.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class mutex:
2121
def __init__(self):
2222
"""Create a new mutex -- initially unlocked."""
23-
self.locked = 0
23+
self.locked = False
2424
self.queue = deque()
2525

2626
def test(self):
@@ -31,7 +31,7 @@ def testandset(self):
3131
"""Atomic test-and-set -- grab the lock if it is not set,
3232
return True if it succeeded."""
3333
if not self.locked:
34-
self.locked = 1
34+
self.locked = True
3535
return True
3636
else:
3737
return False
@@ -52,4 +52,4 @@ def unlock(self):
5252
function, argument = self.queue.popleft()
5353
function(argument)
5454
else:
55-
self.locked = 0
55+
self.locked = False

0 commit comments

Comments
 (0)