mirror of
https://github.com/python/cpython.git
synced 2025-12-09 02:35:14 +00:00
Explain use of currentThread() in _Condition methods.
This commit is contained in:
parent
88b1defb6f
commit
29c2106465
1 changed files with 2 additions and 2 deletions
|
|
@ -181,7 +181,7 @@ class _Condition(_Verbose):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def wait(self, timeout=None):
|
def wait(self, timeout=None):
|
||||||
me = currentThread()
|
currentThread() # for side-effect
|
||||||
assert self._is_owned(), "wait() of un-acquire()d lock"
|
assert self._is_owned(), "wait() of un-acquire()d lock"
|
||||||
waiter = _allocate_lock()
|
waiter = _allocate_lock()
|
||||||
waiter.acquire()
|
waiter.acquire()
|
||||||
|
|
@ -223,7 +223,7 @@ class _Condition(_Verbose):
|
||||||
self._acquire_restore(saved_state)
|
self._acquire_restore(saved_state)
|
||||||
|
|
||||||
def notify(self, n=1):
|
def notify(self, n=1):
|
||||||
me = currentThread()
|
currentThread() # for side-effect
|
||||||
assert self._is_owned(), "notify() of un-acquire()d lock"
|
assert self._is_owned(), "notify() of un-acquire()d lock"
|
||||||
__waiters = self.__waiters
|
__waiters = self.__waiters
|
||||||
waiters = __waiters[:n]
|
waiters = __waiters[:n]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue