blob: a1d977ddf6d74feb2ddc00ef14c0cd17900e4330 [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001:mod:`dummy_thread` --- Drop-in replacement for the :mod:`thread` module
2========================================================================
3
4.. module:: dummy_thread
5 :synopsis: Drop-in replacement for the thread module.
6
Georg Brandl8a710dc2008-05-25 12:34:57 +00007.. note::
8 The :mod:`dummy_thread` module has been renamed to :mod:`_dummy_thread` in
Ezio Melotti510ff542012-05-03 19:21:40 +03009 Python 3. The :term:`2to3` tool will automatically adapt imports when
10 converting your sources to Python 3; however, you should consider using the
Georg Brandl8a710dc2008-05-25 12:34:57 +000011 high-lever :mod:`dummy_threading` module instead.
12
Éric Araujo29a0b572011-08-19 02:14:03 +020013**Source code:** :source:`Lib/dummy_thread.py`
14
15--------------
Georg Brandl8ec7f652007-08-15 14:28:01 +000016
17This module provides a duplicate interface to the :mod:`thread` module. It is
18meant to be imported when the :mod:`thread` module is not provided on a
19platform.
20
21Suggested usage is::
22
23 try:
24 import thread as _thread
25 except ImportError:
26 import dummy_thread as _thread
27
28Be careful to not use this module where deadlock might occur from a thread
29being created that blocks waiting for another thread to be created. This often
30occurs with blocking I/O.
31