diff options
author | Georg Brandl <georg@python.org> | 2008-05-25 13:05:15 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-25 13:05:15 (GMT) |
commit | 2067bfdf253e134a4144d3747300dbfcc7cc6203 (patch) | |
tree | 76613f07319d07cc4f0159769131a051504f8c69 /Doc/library | |
parent | 3b4b45bfe546b023383d4382af7767359390e264 (diff) | |
download | cpython-2067bfdf253e134a4144d3747300dbfcc7cc6203.zip cpython-2067bfdf253e134a4144d3747300dbfcc7cc6203.tar.gz cpython-2067bfdf253e134a4144d3747300dbfcc7cc6203.tar.bz2 |
Rename thread to _thread and dummy_thread to _dummy_thread. Issue #2875.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/_dummy_thread.rst | 22 | ||||
-rw-r--r-- | Doc/library/_thread.rst (renamed from Doc/library/thread.rst) | 17 | ||||
-rw-r--r-- | Doc/library/dummy_thread.rst | 23 | ||||
-rw-r--r-- | Doc/library/dummy_threading.rst | 13 | ||||
-rw-r--r-- | Doc/library/someos.rst | 4 | ||||
-rw-r--r-- | Doc/library/threading.rst | 9 |
6 files changed, 42 insertions, 46 deletions
diff --git a/Doc/library/_dummy_thread.rst b/Doc/library/_dummy_thread.rst new file mode 100644 index 0000000..62e5708 --- /dev/null +++ b/Doc/library/_dummy_thread.rst @@ -0,0 +1,22 @@ +:mod:`_dummy_thread` --- Drop-in replacement for the :mod:`_thread` module +========================================================================== + +.. module:: _dummy_thread + :synopsis: Drop-in replacement for the _thread module. + + +This module provides a duplicate interface to the :mod:`_thread` module. It is +meant to be imported when the :mod:`_thread` module is not provided on a +platform. + +Suggested usage is:: + + try: + import _thread + except ImportError: + import dummy_thread as _thread + +Be careful to not use this module where deadlock might occur from a thread being +created that blocks waiting for another thread to be created. This often occurs +with blocking I/O. + diff --git a/Doc/library/thread.rst b/Doc/library/_thread.rst index 31d58e7..95214d6 100644 --- a/Doc/library/thread.rst +++ b/Doc/library/_thread.rst @@ -1,9 +1,8 @@ +:mod:`_thread` --- Low-level threading API +========================================== -:mod:`thread` --- Multiple threads of control -============================================= - -.. module:: thread - :synopsis: Create multiple threads of control within one interpreter. +.. module:: _thread + :synopsis: Low-level threading API. .. index:: @@ -25,8 +24,8 @@ threading API built on top of this module. The module is optional. It is supported on Windows, Linux, SGI IRIX, Solaris 2.x, as well as on systems that have a POSIX thread (a.k.a. "pthread") -implementation. For systems lacking the :mod:`thread` module, the -:mod:`dummy_thread` module is available. It duplicates this module's interface +implementation. For systems lacking the :mod:`_thread` module, the +:mod:`_dummy_thread` module is available. It duplicates this module's interface and can be used as a drop-in replacement. It defines the following constant and functions: @@ -132,9 +131,9 @@ Lock objects have the following methods: In addition to these methods, lock objects can also be used via the :keyword:`with` statement, e.g.:: - import thread + import _thread - a_lock = thread.allocate_lock() + a_lock = _thread.allocate_lock() with a_lock: print("a_lock is locked while this executes") diff --git a/Doc/library/dummy_thread.rst b/Doc/library/dummy_thread.rst deleted file mode 100644 index 0b2cb17..0000000 --- a/Doc/library/dummy_thread.rst +++ /dev/null @@ -1,23 +0,0 @@ - -:mod:`dummy_thread` --- Drop-in replacement for the :mod:`thread` module -======================================================================== - -.. module:: dummy_thread - :synopsis: Drop-in replacement for the thread module. - - -This module provides a duplicate interface to the :mod:`thread` module. It is -meant to be imported when the :mod:`thread` module is not provided on a -platform. - -Suggested usage is:: - - try: - import thread as _thread - except ImportError: - import dummy_thread as _thread - -Be careful to not use this module where deadlock might occur from a thread -being created that blocks waiting for another thread to be created. This often -occurs with blocking I/O. - diff --git a/Doc/library/dummy_threading.rst b/Doc/library/dummy_threading.rst index 0ffb687..0658df2 100644 --- a/Doc/library/dummy_threading.rst +++ b/Doc/library/dummy_threading.rst @@ -1,4 +1,3 @@ - :mod:`dummy_threading` --- Drop-in replacement for the :mod:`threading` module ============================================================================== @@ -7,17 +6,17 @@ This module provides a duplicate interface to the :mod:`threading` module. It -is meant to be imported when the :mod:`thread` module is not provided on a +is meant to be imported when the :mod:`_thread` module is not provided on a platform. Suggested usage is:: try: - import threading as _threading + import threading except ImportError: - import dummy_threading as _threading + import dummy_threading -Be careful to not use this module where deadlock might occur from a thread -being created that blocks waiting for another thread to be created. This often -occurs with blocking I/O. +Be careful to not use this module where deadlock might occur from a thread being +created that blocks waiting for another thread to be created. This often occurs +with blocking I/O. diff --git a/Doc/library/someos.rst b/Doc/library/someos.rst index 5ee96bc..160ce48 100644 --- a/Doc/library/someos.rst +++ b/Doc/library/someos.rst @@ -14,10 +14,10 @@ some other systems as well (e.g. Windows or NT). Here's an overview: .. toctree:: select.rst - thread.rst threading.rst - dummy_thread.rst dummy_threading.rst + _thread.rst + _dummy_thread.rst mmap.rst readline.rst rlcompleter.rst diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index 6be2f62..2381f24 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -6,12 +6,11 @@ :synopsis: Higher-level threading interface. -This module constructs higher-level threading interfaces on top of the lower -level :mod:`thread` module. -See also the :mod:`queue` module. +This module constructs higher-level threading interfaces on top of the lower +level :mod:`_thread` module. See also the :mod:`queue` module. The :mod:`dummy_threading` module is provided for situations where -:mod:`threading` cannot be used because :mod:`thread` is missing. +:mod:`threading` cannot be used because :mod:`_thread` is missing. This module defines the following functions and objects: @@ -170,7 +169,7 @@ Lock Objects A primitive lock is a synchronization primitive that is not owned by a particular thread when locked. In Python, it is currently the lowest level -synchronization primitive available, implemented directly by the :mod:`thread` +synchronization primitive available, implemented directly by the :mod:`_thread` extension module. A primitive lock is in one of two states, "locked" or "unlocked". It is created |