MEL
Microthread & Execution library
mel::tasking::Event_mthread< MultithreadPolicy > Class Template Reference

class similar to Event Class (which is for thread synchronization) but for Process (with Microthread behaviour)
More...

#include <Event_mthread.h>

Inheritance diagram for mel::tasking::Event_mthread< MultithreadPolicy >:
mel::tasking::EventMTThreadSafePolicy mel::tasking::EventBase

Public Member Functions

 Event_mthread (bool autoRelease=true, bool signaled=false)
 
void set (bool sendToAll=true)
 
EEventMTWaitCode wait (unsigned int msecs=EVENTMT_WAIT_INFINITE)
 
template<class F >
EEventMTWaitCode waitAndDo (F postSleep, unsigned int msecs=EVENTMT_WAIT_INFINITE)
 
void reset ()
 

Protected Member Functions

EEventMTWaitCode _wait (unsigned int msecs)
 
template<class F >
EEventMTWaitCode _waitAndDo (F postSleep, unsigned int msecs)
 
void _set (bool sendToAll)
 

Protected Attributes

bool mSignaled
 
bool mAutoRelease
 
TProcessList mWaitingProcesses
 

Detailed Description

template<class MultithreadPolicy = EventMTThreadSafePolicy>
class mel::tasking::Event_mthread< MultithreadPolicy >

class similar to Event Class (which is for thread synchronization) but for Process (with Microthread behaviour)

Constructor & Destructor Documentation

◆ Event_mthread()

template<class MultithreadPolicy = EventMTThreadSafePolicy>
mel::tasking::Event_mthread< MultithreadPolicy >::Event_mthread ( bool  autoRelease = true,
bool  signaled = false 
)
inline

Creates a new event.

Parameters
autoReleaseflag indicating if the new vent should be auto-reset whenever a wait operation terminates (the default value is true)
signaledflag indicating the initial status of the event. If set to true, the event will be created as "signaled" meaning the next wait operation will return immediately.

Member Function Documentation

◆ set()

template<class MultithreadPolicy = EventMTThreadSafePolicy>
void mel::tasking::Event_mthread< MultithreadPolicy >::set ( bool  sendToAll = true)
inline

activate event

Parameters
[in]sendToAllIf true then all attached Processed are awake else, only one in FIFO way

◆ wait()

template<class MultithreadPolicy = EventMTThreadSafePolicy>
EEventMTWaitCode mel::tasking::Event_mthread< MultithreadPolicy >::wait ( unsigned int  msecs = EVENTMT_WAIT_INFINITE)
inline

wait for event to be triggered

Parameters
[in]msecsto wait for
Returns
EEventMTWaitCode

◆ waitAndDo()

template<class MultithreadPolicy = EventMTThreadSafePolicy>
template<class F >
EEventMTWaitCode mel::tasking::Event_mthread< MultithreadPolicy >::waitAndDo ( postSleep,
unsigned int  msecs = EVENTMT_WAIT_INFINITE 
)
inline

sleep Process, executing callback on sleep,until wakeup

Returns
bool with same meaning as wait

The documentation for this class was generated from the following file: