I'm porting a FreeRTOS-based application to C++ std threads. The basic structure of the application contains a an "event loop" thread, which works as such:
while (true)
{
const EventBits_t bits = xEventGroupWaitBits(event_group, EVENTS, pdTRUE, pdFALSE, portMAX_DELAY);
if (bit & EVENT_1)
{
...
}
if (bit & EVENT_2)
{
...
}
Where other "producer" threads are responsible of xEventGroupSetBits(event_group, EVENT_1)ing events.
What is the best way to port it to C++ std theads?