mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
asyncio: document locks
This commit is contained in:
parent
0da1d29c8a
commit
c37dd614b6
2 changed files with 219 additions and 3 deletions
|
@ -79,7 +79,7 @@ class Lock:
|
|||
return '<{} [{}]>'.format(res[1:-1], extra)
|
||||
|
||||
def locked(self):
|
||||
"""Return true if lock is acquired."""
|
||||
"""Return True if lock is acquired."""
|
||||
return self._locked
|
||||
|
||||
@tasks.coroutine
|
||||
|
@ -138,7 +138,7 @@ class Lock:
|
|||
|
||||
|
||||
class Event:
|
||||
"""An Event implementation, our equivalent to threading.Event.
|
||||
"""An Event implementation, asynchronous equivalent to threading.Event.
|
||||
|
||||
Class implementing event objects. An event manages a flag that can be set
|
||||
to true with the set() method and reset to false with the clear() method.
|
||||
|
@ -162,7 +162,7 @@ class Event:
|
|||
return '<{} [{}]>'.format(res[1:-1], extra)
|
||||
|
||||
def is_set(self):
|
||||
"""Return true if and only if the internal flag is true."""
|
||||
"""Return True if and only if the internal flag is true."""
|
||||
return self._value
|
||||
|
||||
def set(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue