Skip to content

Commit 89081bc

Browse files
authored
Fix undefined reference to `pxCurrentTCB' me-no-dev#1442
1 parent 67de9cd commit 89081bc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/AsyncWebSynchronization.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class AsyncWebLock
2626
}
2727

2828
bool lock() const {
29-
extern void *pxCurrentTCB;
30-
if (_lockedBy != pxCurrentTCB) {
31-
xSemaphoreTake(_lock, portMAX_DELAY);
32-
_lockedBy = pxCurrentTCB;
33-
return true;
29+
TaskHandle_t currentTask = xTaskGetCurrentTaskHandle();
30+
if (_lockedBy != currentTask) {
31+
xSemaphoreTake(_lock, portMAX_DELAY);
32+
_lockedBy = currentTask;
33+
return true;
3434
}
3535
return false;
3636
}
@@ -84,4 +84,4 @@ class AsyncWebLockGuard
8484
}
8585
};
8686

87-
#endif // ASYNCWEBSYNCHRONIZATION_H_
87+
#endif // ASYNCWEBSYNCHRONIZATION_H_

0 commit comments

Comments
 (0)