2015-02-14 19:30:48 +00:00
|
|
|
``tornado.locks`` -- Synchronization primitives
|
|
|
|
===============================================
|
|
|
|
|
|
|
|
.. versionadded:: 4.2
|
|
|
|
|
2018-03-04 22:50:58 +00:00
|
|
|
Coordinate coroutines with synchronization primitives analogous to
|
|
|
|
those the standard library provides to threads. These classes are very
|
|
|
|
similar to those provided in the standard library's `asyncio package
|
|
|
|
<https://docs.python.org/3/library/asyncio-sync.html>`_.
|
2015-03-25 10:18:32 +00:00
|
|
|
|
2017-02-05 22:43:39 +00:00
|
|
|
.. warning::
|
|
|
|
|
2018-12-30 19:03:06 +00:00
|
|
|
Note that these primitives are not actually thread-safe and cannot
|
|
|
|
be used in place of those from the standard library's `threading`
|
|
|
|
module--they are meant to coordinate Tornado coroutines in a
|
|
|
|
single-threaded app, not to protect shared objects in a
|
2017-02-05 22:43:39 +00:00
|
|
|
multithreaded app.
|
2015-03-25 10:18:32 +00:00
|
|
|
|
2015-03-26 10:31:57 +00:00
|
|
|
.. automodule:: tornado.locks
|
2015-03-25 10:18:32 +00:00
|
|
|
|
2015-03-26 10:31:57 +00:00
|
|
|
Condition
|
|
|
|
---------
|
|
|
|
.. autoclass:: Condition
|
|
|
|
:members:
|
2015-03-25 10:18:32 +00:00
|
|
|
|
2015-03-27 10:17:31 +00:00
|
|
|
Event
|
|
|
|
-----
|
|
|
|
.. autoclass:: Event
|
|
|
|
:members:
|
|
|
|
|
2015-03-31 02:41:05 +00:00
|
|
|
Semaphore
|
|
|
|
---------
|
|
|
|
.. autoclass:: Semaphore
|
|
|
|
:members:
|
|
|
|
|
2015-04-04 12:39:11 +00:00
|
|
|
BoundedSemaphore
|
|
|
|
----------------
|
|
|
|
.. autoclass:: BoundedSemaphore
|
|
|
|
:members:
|
|
|
|
:inherited-members:
|
2015-04-19 03:04:13 +00:00
|
|
|
|
|
|
|
Lock
|
|
|
|
----
|
|
|
|
.. autoclass:: Lock
|
|
|
|
:members:
|
|
|
|
:inherited-members:
|