| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 1 | :mod:`dummy_threading` --- Drop-in replacement for the :mod:`threading` module | 
 | 2 | ============================================================================== | 
 | 3 |  | 
 | 4 | .. module:: dummy_threading | 
 | 5 |    :synopsis: Drop-in replacement for the threading module. | 
 | 6 |  | 
 | 7 |  | 
 | 8 | This module provides a duplicate interface to the :mod:`threading` module.  It | 
| Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 9 | is meant to be imported when the :mod:`_thread` module is not provided on a | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 10 | platform. | 
 | 11 |  | 
 | 12 | Suggested usage is:: | 
 | 13 |  | 
 | 14 |    try: | 
| Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 15 |        import threading | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 16 |    except ImportError: | 
| Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 17 |        import dummy_threading | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 18 |  | 
| Georg Brandl | 2067bfd | 2008-05-25 13:05:15 +0000 | [diff] [blame] | 19 | Be careful to not use this module where deadlock might occur from a thread being | 
 | 20 | created that blocks waiting for another thread to be created.  This often occurs | 
 | 21 | with blocking I/O. | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 22 |  |