OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
A WaitableEvent is useful in the scenario of a singler consumer, multiple producers The consumer will wait until any of the producers wake it up to consume the work. More...
#include <OgreWaitableEvent.h>
Public Member Functions | |
WaitableEvent () | |
~WaitableEvent () | |
bool | wait () |
Waits until another thread calls wake(). More... | |
void | wake () |
Tells the other thread to wake up from wait(). More... | |
A WaitableEvent is useful in the scenario of a singler consumer, multiple producers The consumer will wait until any of the producers wake it up to consume the work.
Ogre::WaitableEvent::WaitableEvent | ( | ) |
Ogre::WaitableEvent::~WaitableEvent | ( | ) |
bool Ogre::WaitableEvent::wait | ( | ) |
Waits until another thread calls wake().
If wake has already been called, we'll return immediately, and we'll go to sleep if you call wait again (unless wake was called again in the middle, of course). If wake has never been called yet, we go to sleep. On error returns false, true if everything's ok.
void Ogre::WaitableEvent::wake | ( | ) |
Tells the other thread to wake up from wait().
Calling wake multiple times without any wait in the middle is the same as calling it just once.