summaryrefslogtreecommitdiff
path: root/Lib/mutex.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-27 23:15:48 +0000
committerBenjamin Peterson <benjamin@python.org>2009-01-27 23:15:48 +0000
commitfd0107fdf9e3ef5bfc77010fa3d8f44e1f28441f (patch)
tree5650386c7c3dbda057afd772f7eede95876c7f6f /Lib/mutex.py
parent9f4f56d4e8c6c4a0221a24a6013b04b02e7916b6 (diff)
downloadcpython-git-fd0107fdf9e3ef5bfc77010fa3d8f44e1f28441f.tar.gz
use True and False
Diffstat (limited to 'Lib/mutex.py')
-rw-r--r--Lib/mutex.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/mutex.py b/Lib/mutex.py
index 9e6b8d43c7..f8acba4a35 100644
--- a/Lib/mutex.py
+++ b/Lib/mutex.py
@@ -20,7 +20,7 @@ from collections import deque
class mutex:
def __init__(self):
"""Create a new mutex -- initially unlocked."""
- self.locked = 0
+ self.locked = False
self.queue = deque()
def test(self):
@@ -31,7 +31,7 @@ class mutex:
"""Atomic test-and-set -- grab the lock if it is not set,
return True if it succeeded."""
if not self.locked:
- self.locked = 1
+ self.locked = True
return True
else:
return False
@@ -52,4 +52,4 @@ class mutex:
function, argument = self.queue.popleft()
function(argument)
else:
- self.locked = 0
+ self.locked = False