Module mutex :: Class mutex
[hide private]
[frames] | no frames]

_ClassType mutex

Instance Methods [hide private]
 
__init__(self)
Create a new mutex -- initially unlocked.
 
test(self)
Test the locked bit of the mutex.
 
testandset(self)
Atomic test-and-set -- grab the lock if it is not set, return True if it succeeded.
 
lock(self, function, argument)
Lock a mutex, call the function with supplied argument when it is acquired.
 
unlock(self)
Unlock a mutex.
Method Details [hide private]

lock(self, function, argument)

 

Lock a mutex, call the function with supplied argument when it is acquired. If the mutex is already locked, place function and argument in the queue.

unlock(self)

 

Unlock a mutex. If the queue is not empty, call the next function with its argument.