Expand description
Contains several variants of POSIX condition variables. A mutex is always included, either as reference or the object itself.
Furthermore, we distinct between
MultiConditionVariable
- waiters can wait on multiple conditions with the draw back that notify_one is not availableConditionVariable
- the condition has to be provided on construction but notify_one is available
Re-exports§
pub use crate::ipc_capable::Handle;
pub use crate::ipc_capable::IpcCapable;
pub use crate::mutex::MutexHandle;
pub use crate::mutex::*;
Structs§
- Condition variable which requires a fixed predicate on creation which is then used in
ConditionVariable::blocking_wait_while()
andConditionVariable::timed_wait_while()
concurrently with the benefit of triggering single waiters. The reason is when one waits on multiple conditions but triggers only one waiter it is possible that a waiter is triggered which condition is not satisfied while another waiter is not signaled which could have continued. This could lead to some deadlocks. - Builder for the
MultiConditionVariable
and theConditionVariable
. It creates a condition variable which already includes a mutex. The design idea originated from the fact that waiting on the same condition variable with two distinct mutexes is undefined behavior according to the posix standard. An integrated mutex avoids this possible pitfall. - Provides access to the underlying type and predicate of a
ConditionVariable
or with a single static condition. - Is returned by the
ConditionVariable
inConditionVariable::notify_all()
orConditionVariable::notify_one()
. It enables the user to change the guarded content before the notification is send. The trigger is signaled when the guard goes out of scope. - Condition variable which allows to use multiple conditions in
MultiConditionVariable::blocking_wait_while()
andMultiConditionVariable::timed_wait_while()
concurrently but with the draw back that only all waiters can be triggered and not one. The reason is when one waits on multiple conditions but triggers only one waiter it is possible that a waiter is triggered which condition is not satisfied while another waiter is not signaled which could have continued. This could lead to some deadlocks. - Is returned by the
MultiConditionVariable
inMultiConditionVariable::notify_all()
. It enables the user to change the guarded content before the notification is send. The trigger is signaled when the guard goes out of scope.
Enums§
- The
ConditionVariableError
enum is a generalization when one doesn’t require the fine-grained error handling enums. One can forward forwardConditionVariableError
as more generic return value when a method returns a Condition***Error. On a higher level it is again convertable intocrate::Error
.