Package qm :: Module lock
[hide private]
[frames] | no frames]

Source Code for Module qm.lock

 1  ######################################################################## 
 2  # 
 3  # File:   lock.py 
 4  # Author: Mark Mitchell 
 5  # Date:   07/03/2002 
 6  # 
 7  # Contents: 
 8  #   Lock 
 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, Threading.Lock() is 
21  # unavailable.  This module provides a class with the same interface 
22  # that works on systems without threads. 
23   
24  try: 
25      import thread 
26      from threading import Lock, RLock 
27  except: 
28   
29      class Lock: 
30   
31          def acquire(blocking = 1): 
32              # The lock can always be acquired. 
33              pass 
34 35 def release(): 36 # There is nothing to do to release the lock. 37 pass 38 39 40 41 class RLock(Lock): 42 43 pass 44