mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Issue #27041: asyncio: Add loop.create_future method
This commit is contained in:
parent
7ed7ce6ee7
commit
7661db6228
14 changed files with 55 additions and 39 deletions
|
@ -170,7 +170,7 @@ class Lock(_ContextManagerMixin):
|
|||
self._locked = True
|
||||
return True
|
||||
|
||||
fut = futures.Future(loop=self._loop)
|
||||
fut = self._loop.create_future()
|
||||
self._waiters.append(fut)
|
||||
try:
|
||||
yield from fut
|
||||
|
@ -258,7 +258,7 @@ class Event:
|
|||
if self._value:
|
||||
return True
|
||||
|
||||
fut = futures.Future(loop=self._loop)
|
||||
fut = self._loop.create_future()
|
||||
self._waiters.append(fut)
|
||||
try:
|
||||
yield from fut
|
||||
|
@ -320,7 +320,7 @@ class Condition(_ContextManagerMixin):
|
|||
|
||||
self.release()
|
||||
try:
|
||||
fut = futures.Future(loop=self._loop)
|
||||
fut = self._loop.create_future()
|
||||
self._waiters.append(fut)
|
||||
try:
|
||||
yield from fut
|
||||
|
@ -433,7 +433,7 @@ class Semaphore(_ContextManagerMixin):
|
|||
True.
|
||||
"""
|
||||
while self._value <= 0:
|
||||
fut = futures.Future(loop=self._loop)
|
||||
fut = self._loop.create_future()
|
||||
self._waiters.append(fut)
|
||||
try:
|
||||
yield from fut
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue