From 89081bcad2ec1f3819c6d268e0d0d902553505db Mon Sep 17 00:00:00 2001 From: sepp89117 <43417395+sepp89117@users.noreply.github.com> Date: Tue, 7 Jan 2025 11:47:58 +0100 Subject: [PATCH] Fix undefined reference to `pxCurrentTCB' #1442 --- src/AsyncWebSynchronization.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/AsyncWebSynchronization.h b/src/AsyncWebSynchronization.h index f36c52dcf..b852c4719 100644 --- a/src/AsyncWebSynchronization.h +++ b/src/AsyncWebSynchronization.h @@ -26,11 +26,11 @@ class AsyncWebLock } bool lock() const { - extern void *pxCurrentTCB; - if (_lockedBy != pxCurrentTCB) { - xSemaphoreTake(_lock, portMAX_DELAY); - _lockedBy = pxCurrentTCB; - return true; + TaskHandle_t currentTask = xTaskGetCurrentTaskHandle(); + if (_lockedBy != currentTask) { + xSemaphoreTake(_lock, portMAX_DELAY); + _lockedBy = currentTask; + return true; } return false; } @@ -84,4 +84,4 @@ class AsyncWebLockGuard } }; -#endif // ASYNCWEBSYNCHRONIZATION_H_ \ No newline at end of file +#endif // ASYNCWEBSYNCHRONIZATION_H_