[Python-checkins] r69039 - python/trunk/Lib/mutex.py
benjamin.peterson
python-checkins at python.org
Wed Jan 28 00:15:48 CET 2009
Author: benjamin.peterson
Date: Wed Jan 28 00:15:48 2009
New Revision: 69039
Log:
use True and False
Modified:
python/trunk/Lib/mutex.py
Modified: python/trunk/Lib/mutex.py
==============================================================================
--- python/trunk/Lib/mutex.py (original)
+++ python/trunk/Lib/mutex.py Wed Jan 28 00:15:48 2009
@@ -20,7 +20,7 @@
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 @@
"""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 @@
function, argument = self.queue.popleft()
function(argument)
else:
- self.locked = 0
+ self.locked = False
More information about the Python-checkins
mailing list