![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
interface for condition variables More...
#include <Os/Condition.hpp>
Public Types | |
enum | Status { OP_OK, ERROR_MUTEX_NOT_HELD, ERROR_DIFFERENT_MUTEX, ERROR_NOT_IMPLEMENTED, NOT_SUPPORTED, ERROR_OTHER } |
Public Member Functions | |
ConditionVariableInterface ()=default | |
Default constructor. More... | |
virtual | ~ConditionVariableInterface ()=default |
Default destructor. More... | |
ConditionVariableInterface (const ConditionVariableInterface &other)=delete | |
copy constructor is forbidden More... | |
virtual ConditionVariableInterface & | operator= (const ConditionVariableInterface &other)=delete |
assignment operator is forbidden More... | |
virtual Status | pend (Os::Mutex &mutex)=0 |
wait on a condition variable More... | |
virtual void | notify ()=0 |
notify a single waiter on this condition variable More... | |
virtual void | notifyAll ()=0 |
notify all waiters on this condition variable More... | |
virtual ConditionVariableHandle * | getHandle ()=0 |
return the underlying condition variable handle (implementation specific). More... | |
Static Public Member Functions | |
static ConditionVariableInterface * | getDelegate (ConditionVariableHandleStorage &aligned_new_memory) |
provide a pointer to a Mutex delegate object More... | |
interface for condition variables
Condition variables allow a program to block on a condition while atomically releasing an Os::Mutex and atomically reacquiring the mutex once the condition has been notified.
Definition at line 20 of file Condition.hpp.
Enumerator | |
---|---|
OP_OK | Operation was successful. |
ERROR_MUTEX_NOT_HELD | When trying to wait but we don't hold the mutex. |
ERROR_DIFFERENT_MUTEX | When trying to use a different mutex than expected mutex. |
ERROR_NOT_IMPLEMENTED | When trying to use a feature that isn't implemented. |
NOT_SUPPORTED | ConditionVariable does not support operation. |
ERROR_OTHER | All other errors. |
Definition at line 22 of file Condition.hpp.
|
default |
Default constructor.
|
virtualdefault |
Default destructor.
|
delete |
copy constructor is forbidden
|
static |
provide a pointer to a Mutex delegate object
get a delegate for condition variable
get a delegate for MutexInterface that intercepts calls for Posix
aligned_new_memory | aligned memory to fill |
Definition at line 20 of file DefaultMutex.cpp.
|
pure virtual |
return the underlying condition variable handle (implementation specific).
Implemented in Os::ConditionVariable, Os::Posix::Mutex::PosixConditionVariable, and Os::Stub::Mutex::StubConditionVariable.
|
pure virtual |
notify a single waiter on this condition variable
Notify a single waiter on this condition variable. It is not necessary to hold the mutex supplied by the waiters and it is advantageous not to hold the lock to prevent immediate re-blocking.
Implemented in Os::ConditionVariable, Os::Posix::Mutex::PosixConditionVariable, and Os::Stub::Mutex::StubConditionVariable.
|
pure virtual |
notify all waiters on this condition variable
Notify all waiters on this condition variable. It is not necessary to hold the mutex supplied by the waiters and it is advantageous not to hold the lock to prevent immediate re-blocking.
Implemented in Os::ConditionVariable, Os::Posix::Mutex::PosixConditionVariable, and Os::Stub::Mutex::StubConditionVariable.
|
virtualdelete |
assignment operator is forbidden
Reimplemented in Os::ConditionVariable, Os::Posix::Mutex::PosixConditionVariable, and Os::Stub::Mutex::StubConditionVariable.
wait on a condition variable
Wait on a condition variable. This function will atomically unlock the provided mutex and block on the condition in one step. Blocking will occur until a future notify
or notifyAll
call is made to this variable on another thread of execution.
mutex | mutex to unlock as part of this operation |
Implemented in Os::ConditionVariable, Os::Posix::Mutex::PosixConditionVariable, and Os::Stub::Mutex::StubConditionVariable.