Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Public Member Functions | |
def | __init__ |
def | test |
def | testandset |
def | lock |
def | unlock |
Data Fields | |
locked | |
queue | |
def 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.
Definition at line 34 of file mutex.py.
References mutex.testandset().
def test | ( | self) |
def testandset | ( | self) |
Atomic test-and-set -- grab the lock if it is not set, return true if it succeeded.
Definition at line 25 of file mutex.py.
References mutex.locked.
def unlock | ( | self) |
Unlock a mutex. If the queue is not empty, call the next function with its argument.
Definition at line 43 of file mutex.py.
References mutex.locked, and mutex.queue.