exopy.utils.flags module¶
Thread safe bit flag with convenient interface.
-
class
exopy.utils.flags.
BitFlag
[source]¶ Bases:
object
Bit flag conveniency class providing thread safety facilities.
- Parameters
flags (iterable[unicode]) – Name of the flags that this flag understand.
-
set
(*flags)[source]¶ Set specified flags.
If a flag is already set this is a no-op. If a thread is waiting on a flag, it gets notified.
-
wait
(timeout, *flags)[source]¶ Wait till some flags are set.
- Parameters
timeout (float|None) – Maximum time to wait. If None waits forever.
flags (iterable[unicode]) – Flags upon which to wait.
- Returns
result – False if the method returned because of the timeout.
- Return type
-
flags
¶