miosix::ConditionVariable Class Reference
[Syncronization]
#include <sync.h>
List of all members.
Detailed Description
A condition variable class for thread synchronization, available from Miosix 1.53.
One or more threads can wait on the condition variable, and the
signal() and
broadcast() llow to wake ne or all the waiting threads.
This class is meant to be a static or global class. Dynamically creating a
ConditionVariable with new or on the stack must be done with care, to avoid deleting a
ConditionVariable while some threads are waiting, and to avoid situations where a thread tries to wait on a deleted
ConditionVariable.
Constructor & Destructor Documentation
miosix::ConditionVariable::ConditionVariable |
( |
|
) |
|
Member Function Documentation
void miosix::ConditionVariable::broadcast |
( |
|
) |
|
Wakeup all waiting threads.
void miosix::ConditionVariable::signal |
( |
|
) |
|
Wakeup one waiting thread. Currently implemented policy is fifo.
void miosix::ConditionVariable::wait |
( |
Mutex & |
m |
) |
[inline] |
Unlock the mutex and wait. If more threads call wait() they must do so specifying the same mutex, otherwise the behaviour is undefined.
- Parameters:
-
void miosix::ConditionVariable::wait |
( |
Lock & |
l |
) |
[inline] |
Unlock the mutex and wait. If more threads call wait() they must do so specifying the same mutex, otherwise the behaviour is undefined.
- Parameters:
-
The documentation for this class was generated from the following files:
- /Users/fede/Documents/Projects/ARM/miosix/miosix_np_2/miosix/kernel/sync.h
- /Users/fede/Documents/Projects/ARM/miosix/miosix_np_2/miosix/kernel/sync.cpp