| Home | Trees | Indices | Help |
|
|---|
|
|
A thread-safe container of a reference to an object (but not the
object itself).
In particular this means it is safe to:
value.set(1)
But unsafe to:
value.get()['key'] = value
Where the latter must be done using something like:
def _setprop():
value.get()['key'] = value
with_lock(value, _setprop)
Operations such as increments are best done as:
value.transform(lambda val: val + 1)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Call fn with the current value as the parameter, and reset the value to the return value of fn. During the execution of fn, all other access to this Value is prevented. If fn raised an exception, the value is not reset. Returns the value returned by fn, or raises the exception raised by fn. |
Acquire this Value for mutually exclusive access. Only ever needed when calling code must perform operations that cannot be done with get(), set() or transform(). |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Fri Nov 25 13:38:18 2011 | http://epydoc.sourceforge.net |