W
Wenhua Zhao
Hi list,
I just noticed that in /usr/lib/python2.7/threading.py
class _Condition(_Verbose):
...
def _is_owned(self):
# Return True if lock is owned by current_thread.
# This method is called only if __lock doesn't have
_is_owned().
if self.__lock.acquire(0):
self.__lock.release()
return False
else:
return True
The return values seem to be wrong. They should be swapped:
def _is_owned(self):
if self.__lock.acquire(0):
self.__lock.release()
return True
else:
return False
Or I understood it wrong here?
Thanks,
Wenhua
I just noticed that in /usr/lib/python2.7/threading.py
class _Condition(_Verbose):
...
def _is_owned(self):
# Return True if lock is owned by current_thread.
# This method is called only if __lock doesn't have
_is_owned().
if self.__lock.acquire(0):
self.__lock.release()
return False
else:
return True
The return values seem to be wrong. They should be swapped:
def _is_owned(self):
if self.__lock.acquire(0):
self.__lock.release()
return True
else:
return False
Or I understood it wrong here?
Thanks,
Wenhua