| 572 | } |
| 573 | |
| 574 | void AsyncHttpClient::processTask(void* parameters) |
| 575 | { |
| 576 | AsyncHttpClient* tthis = static_cast<AsyncHttpClient*>(parameters); |
| 577 | |
| 578 | if ((nullptr != tthis) && |
| 579 | (nullptr != tthis->m_processTaskSemaphore)) |
| 580 | { |
| 581 | (void)xSemaphoreTake(tthis->m_processTaskSemaphore, portMAX_DELAY); |
| 582 | |
| 583 | while (false == tthis->m_processTaskExit) |
| 584 | { |
| 585 | tthis->processCmdQueue(); |
| 586 | tthis->processEvtQueue(); |
| 587 | |
| 588 | delay(PROCESS_TASK_PERIOD); |
| 589 | } |
| 590 | |
| 591 | /* Ensure that any pending request/connection is aborted. */ |
| 592 | tthis->abort(); |
| 593 | |
| 594 | /* The global mutex must be released from the same task it |
| 595 | * was taken, otherwise it will lead to a assertion in FreeRTOS. |
| 596 | */ |
| 597 | tthis->giveGlobalMutex(); |
| 598 | |
| 599 | (void)xSemaphoreGive(tthis->m_processTaskSemaphore); |
| 600 | } |
| 601 | |
| 602 | vTaskDelete(nullptr); |
| 603 | } |
| 604 | |
| 605 | void AsyncHttpClient::processCmdQueue() |
| 606 | { |
nothing calls this directly
no test coverage detected