mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
Convert a pile of obvious "yes/no" functions to return bool.
This commit is contained in:
parent
2f486b7fa6
commit
bc0e910826
34 changed files with 117 additions and 122 deletions
|
@ -24,12 +24,12 @@ class mutex:
|
|||
|
||||
def testandset(self):
|
||||
"""Atomic test-and-set -- grab the lock if it is not set,
|
||||
return true if it succeeded."""
|
||||
return True if it succeeded."""
|
||||
if not self.locked:
|
||||
self.locked = 1
|
||||
return 1
|
||||
return True
|
||||
else:
|
||||
return 0
|
||||
return False
|
||||
|
||||
def lock(self, function, argument):
|
||||
"""Lock a mutex, call the function with supplied argument
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue