1``tornado.locks`` -- Synchronization primitives
2===============================================
3
4.. versionadded:: 4.2
5
6Coordinate coroutines with synchronization primitives analogous to
7those the standard library provides to threads. These classes are very
8similar to those provided in the standard library's `asyncio package
9<https://docs.python.org/3/library/asyncio-sync.html>`_.
10
11.. warning::
12
13   Note that these primitives are not actually thread-safe and cannot
14   be used in place of those from the standard library's `threading`
15   module--they are meant to coordinate Tornado coroutines in a
16   single-threaded app, not to protect shared objects in a
17   multithreaded app.
18
19.. automodule:: tornado.locks
20
21   Condition
22   ---------
23   .. autoclass:: Condition
24    :members:
25
26   Event
27   -----
28   .. autoclass:: Event
29    :members:
30
31   Semaphore
32   ---------
33   .. autoclass:: Semaphore
34    :members:
35
36   BoundedSemaphore
37   ----------------
38   .. autoclass:: BoundedSemaphore
39    :members:
40    :inherited-members:
41
42   Lock
43   ----
44   .. autoclass:: Lock
45    :members:
46    :inherited-members:
47