class documentation
Context manager to guard a critical resource path.
| Method | __enter__ |
Enter the critical section. |
| Method | __exit__ |
Exit the critical section. |
| Method | __init__ |
Initialization of the context manager. |
| Instance Variable | id |
Resource ID of the resource to be monitored. |
| Instance Variable | state |
State of the resource. |
| Instance Variable | timeout |
Timeout for waiting for the critical section. |
def __exit__(self, exctype:
type[ BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None) -> bool | None:
¶
Exit the critical section.
| Parameters | |
exctype:type[ | Exception type |
excinst:BaseException | None | Exception instance |
exctb:TracebackType | None | Exception traceback |
| Returns | |
bool | None | Always None |
Initialization of the context manager.
| Parameters | |
id:str | Resource ID of the resource to be monitored. This may also be any other ID in cases where the critical section is not a resource. |
state:str | None | State of the resource. |
timeout:float | None | Timeout for waiting for the critical section. A timeout of 0.0 times out immediately. |