Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 1 | :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 | |
Raymond Hettinger | 3029aff | 2011-02-10 08:09:36 +0000 | [diff] [blame] | 7 | **Source code:** :source:`Lib/_dummy_thread.py` |
| 8 | |
| 9 | -------------- |
Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 10 | |
| 11 | This module provides a duplicate interface to the :mod:`_thread` module. It is |
| 12 | meant to be imported when the :mod:`_thread` module is not provided on a |
| 13 | platform. |
| 14 | |
| 15 | Suggested usage is:: |
| 16 | |
| 17 | try: |
| 18 | import _thread |
| 19 | except ImportError: |
R David Murray | 041d553 | 2013-02-09 13:23:46 -0500 | [diff] [blame] | 20 | import _dummy_thread as _thread |
Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 21 | |
| 22 | Be careful to not use this module where deadlock might occur from a thread being |
| 23 | created that blocks waiting for another thread to be created. This often occurs |
| 24 | with blocking I/O. |
| 25 | |