Home | Trees | Index | Help |
---|
|
1 ######################################################################## 2 # 3 # File: queue.py 4 # Author: Mark Mitchell 5 # Date: 01/07/2002 6 # 7 # Contents: 8 # Queue 9 # 10 # Copyright (c) 2002 by CodeSourcery, LLC. All rights reserved. 11 # 12 # For license terms see the file COPYING. 13 # 14 ######################################################################## 15 16 ######################################################################## 17 # Notes 18 ######################################################################## 19 20 # On systems that do not support threads, the Python Queue module 21 # does not work. This is probably a bug in Python; if there are 22 # no threads, there is no difficulty in being threadsafe, and the 23 # module should simply omit the calls to acquire and release locks. 24 # This module is a manual implementation of this idea, with the 25 # limitation that the maxsize parameter to the initialization function 26 # must always be zero. 27 28 try: 29 import thread 30 31 # If we successfully imported the thread module, we can just use 32 # the builtin Queue. 33 from Queue import * 34 except: 35 # This code is based on the Python 2.2 Queue.py, but without 36 # the threading calls. 37 class Empty(Exception): 38 "Exception raised by Queue.get(block=0)/get_nowait()." 39 pass
Home | Trees | Index | Help |
---|
Generated by Epydoc 3.0alpha2 on Fri Sep 28 01:00:54 2007 | http://epydoc.sf.net |