summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/locks.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-06-28 22:47:28 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-06-28 22:47:28 (GMT)
commit6cdcf0d5ed565c5ec3a36331e64fbf230550543a (patch)
treef8ecb5acfd3e9b5999d3ed7bd42eefba8282f177 /Lib/asyncio/locks.py
parent41c8da95f4ed6e08e6f904ee11ca7cef074541a9 (diff)
parentf951d28ac890063e3ecef56aa8cf851b1152d9dd (diff)
downloadcpython-6cdcf0d5ed565c5ec3a36331e64fbf230550543a.zip
cpython-6cdcf0d5ed565c5ec3a36331e64fbf230550543a.tar.gz
cpython-6cdcf0d5ed565c5ec3a36331e64fbf230550543a.tar.bz2
(Merge 3.4) asyncio: sync with Tulip, add a new asyncio.coroutines module
Diffstat (limited to 'Lib/asyncio/locks.py')
-rw-r--r--Lib/asyncio/locks.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
index 29c4434..8d9e3b4 100644
--- a/Lib/asyncio/locks.py
+++ b/Lib/asyncio/locks.py
@@ -6,7 +6,7 @@ import collections
from . import events
from . import futures
-from . import tasks
+from .coroutines import coroutine
class _ContextManager:
@@ -112,7 +112,7 @@ class Lock:
"""Return True if lock is acquired."""
return self._locked
- @tasks.coroutine
+ @coroutine
def acquire(self):
"""Acquire a lock.
@@ -225,7 +225,7 @@ class Event:
to true again."""
self._value = False
- @tasks.coroutine
+ @coroutine
def wait(self):
"""Block until the internal flag is true.
@@ -278,7 +278,7 @@ class Condition:
extra = '{},waiters:{}'.format(extra, len(self._waiters))
return '<{} [{}]>'.format(res[1:-1], extra)
- @tasks.coroutine
+ @coroutine
def wait(self):
"""Wait until notified.
@@ -306,7 +306,7 @@ class Condition:
finally:
yield from self.acquire()
- @tasks.coroutine
+ @coroutine
def wait_for(self, predicate):
"""Wait until a predicate becomes true.
@@ -402,7 +402,7 @@ class Semaphore:
"""Returns True if semaphore can not be acquired immediately."""
return self._value == 0
- @tasks.coroutine
+ @coroutine
def acquire(self):
"""Acquire a semaphore.