| 107 | } |
| 108 | |
| 109 | void ConditionVariableESP32::notify_all() FL_NOEXCEPT { |
| 110 | if (mMutex == nullptr || mWaitQueue == nullptr) { |
| 111 | return; |
| 112 | } |
| 113 | |
| 114 | SemaphoreHandle_t mutex = static_cast<SemaphoreHandle_t>(mMutex); |
| 115 | QueueHandle_t queue = static_cast<QueueHandle_t>(mWaitQueue); |
| 116 | |
| 117 | // Lock internal mutex |
| 118 | xSemaphoreTake(mutex, portMAX_DELAY); |
| 119 | |
| 120 | // Wake all waiting tasks |
| 121 | WaitingTask waiter; |
| 122 | while (xQueueReceive(queue, &waiter, 0) == pdTRUE) { |
| 123 | waiter.notified = true; |
| 124 | xTaskNotifyGive(waiter.task); |
| 125 | } |
| 126 | |
| 127 | // Unlock internal mutex |
| 128 | xSemaphoreGive(mutex); |
| 129 | } |
| 130 | |
| 131 | //============================================================================= |
| 132 | // Template Method Implementations |
no outgoing calls
no test coverage detected