]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
queues: Call out thread-unsafety in docs
authorBen Darnell <ben@bendarnell.com>
Sun, 5 Feb 2017 22:43:39 +0000 (17:43 -0500)
committerBen Darnell <ben@bendarnell.com>
Sun, 5 Feb 2017 22:44:02 +0000 (17:44 -0500)
Fixes #1923

docs/locks.rst
tornado/queues.py

index 7115b0da703dcf496c8fff66638e77da0ee1f7b3..94184db2ac19810a3a596cb5380246d3e05aec4c 100644 (file)
@@ -6,10 +6,12 @@
 Coordinate coroutines with synchronization primitives analogous to those the
 standard library provides to threads.
 
-*(Note that these primitives are not actually thread-safe and cannot be used in
-place of those from the standard library--they are meant to coordinate Tornado
-coroutines in a single-threaded app, not to protect shared objects in a
-multithreaded app.)*
+.. warning::
+
+   Note that these primitives are not actually thread-safe and cannot be used in
+   place of those from the standard library--they are meant to coordinate Tornado
+   coroutines in a single-threaded app, not to protect shared objects in a
+   multithreaded app.
 
 .. automodule:: tornado.locks
 
index b8e9b56939c82be6e66970bad5334e46dda4f741..77eda98b019642c0c40c43199080d0632f6533d7 100644 (file)
 # License for the specific language governing permissions and limitations
 # under the License.
 
+"""Asynchronous queues for coroutines.
+
+.. warning::
+
+   Unlike the standard library's `queue` module, the classes defined here
+   are *not* thread-safe. To use these queues from another thread,
+   use `.IOLoop.add_callback` to transfer control to the `.IOLoop` thread
+   before calling any queue methods.
+"""
+
 from __future__ import absolute_import, division, print_function, with_statement
 
 import collections