Module dummy_thread :: Class LockType
[hide private]
[frames] | no frames]

type LockType

object --+
         |
        LockType

Class implementing dummy implementation of thread.LockType.

Compatibility is maintained by maintaining self.locked_status which is a boolean that stores the state of the lock. Pickling of the lock, though, should not be done since if the thread module is then used with an unpickled ``lock()`` from here problems could occur from this class not having atomic methods.

Instance Methods [hide private]
 
__init__(self)
 
acquire(self, waitflag=None)
Dummy implementation of acquire().
 
__enter__(self, waitflag=None)
Dummy implementation of acquire().
 
__exit__(self, typ, val, tb)
 
release(self)
Release the dummy lock.
 
locked(self)
Method Details [hide private]

__init__(self)
(Constructor)

 
Overrides: object.__init__
(inherited documentation)

acquire(self, waitflag=None)

 

Dummy implementation of acquire().

For blocking calls, self.locked_status is automatically set to True and returned appropriately based on value of ``waitflag``. If it is non-blocking, then the value is actually checked and not set if it is already acquired. This is all done so that threading.Condition's assert statements aren't triggered and throw a little fit.

__enter__(self, waitflag=None)

 

Dummy implementation of acquire().

For blocking calls, self.locked_status is automatically set to True and returned appropriately based on value of ``waitflag``. If it is non-blocking, then the value is actually checked and not set if it is already acquired. This is all done so that threading.Condition's assert statements aren't triggered and throw a little fit.