Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7b2c3c68
Commit
7b2c3c68
authored
Feb 26, 2015
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asyncio doc: lock classes are not thread safe
parent
ed135f46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
Doc/library/asyncio-sync.rst
Doc/library/asyncio-sync.rst
+11
-3
No files found.
Doc/library/asyncio-sync.rst
View file @
7b2c3c68
...
@@ -54,6 +54,8 @@ Lock
...
@@ -54,6 +54,8 @@ Lock
Locks also support the context management protocol. ``(yield from lock)``
Locks also support the context management protocol. ``(yield from lock)``
should be used as context manager expression.
should be used as context manager expression.
This class is :ref:`not thread safe <asyncio-multithreading>`.
Usage::
Usage::
lock = Lock()
lock = Lock()
...
@@ -117,6 +119,8 @@ Event
...
@@ -117,6 +119,8 @@ Event
method. The :meth:`wait` method blocks until the flag is true. The flag is
method. The :meth:`wait` method blocks until the flag is true. The flag is
initially false.
initially false.
This class is :ref:`not thread safe <asyncio-multithreading>`.
.. method:: clear()
.. method:: clear()
Reset the internal flag to false. Subsequently, coroutines calling
Reset the internal flag to false. Subsequently, coroutines calling
...
@@ -160,6 +164,8 @@ Condition
...
@@ -160,6 +164,8 @@ Condition
object, and it is used as the underlying lock. Otherwise,
object, and it is used as the underlying lock. Otherwise,
a new :class:`Lock` object is created and used as the underlying lock.
a new :class:`Lock` object is created and used as the underlying lock.
This class is :ref:`not thread safe <asyncio-multithreading>`.
.. coroutinemethod:: acquire()
.. coroutinemethod:: acquire()
Acquire the underlying lock.
Acquire the underlying lock.
...
@@ -252,6 +258,8 @@ Semaphore
...
@@ -252,6 +258,8 @@ Semaphore
defaults to ``1``. If the value given is less than ``0``, :exc:`ValueError`
defaults to ``1``. If the value given is less than ``0``, :exc:`ValueError`
is raised.
is raised.
This class is :ref:`not thread safe <asyncio-multithreading>`.
.. coroutinemethod:: acquire()
.. coroutinemethod:: acquire()
Acquire a semaphore.
Acquire a semaphore.
...
@@ -279,8 +287,8 @@ BoundedSemaphore
...
@@ -279,8 +287,8 @@ BoundedSemaphore
.. class:: BoundedSemaphore(value=1, \*, loop=None)
.. class:: BoundedSemaphore(value=1, \*, loop=None)
A bounded semaphore implementation. Inherit from :class:`Semaphore`.
A bounded semaphore implementation. Inherit from :class:`Semaphore`.
This raises :exc:`ValueError` in :meth:`~Semaphore.release` if it would
This raises :exc:`ValueError` in :meth:`~Semaphore.release` if it would
increase the value above the initial value.
increase the value above the initial value.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment