2020-07-05 23:11:40 +02:00
|
|
|
#include "NotifiedWorkerThread.h"
|
|
|
|
|
|
2020-09-04 17:23:17 -07:00
|
|
|
#ifdef HAS_FREE_RTOS
|
|
|
|
|
|
2020-07-05 23:11:40 +02:00
|
|
|
namespace concurrency {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Notify this thread so it can run
|
|
|
|
|
*/
|
2020-09-04 17:23:17 -07:00
|
|
|
void FreeRtosNotifiedWorkerThread::notify(uint32_t v, eNotifyAction action)
|
2020-07-05 23:11:40 +02:00
|
|
|
{
|
|
|
|
|
xTaskNotify(taskHandle, v, action);
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-04 17:23:17 -07:00
|
|
|
void FreeRtosNotifiedWorkerThread::block()
|
2020-07-05 23:11:40 +02:00
|
|
|
{
|
|
|
|
|
xTaskNotifyWait(0, // don't clear notification on entry
|
|
|
|
|
clearOnRead, ¬ification, portMAX_DELAY); // Wait forever
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace concurrency
|
2020-09-04 17:23:17 -07:00
|
|
|
|
|
|
|
|
#endif
|