mirror of
https://github.com/me-no-dev/ESPAsyncWebServer.git
synced 2025-09-27 06:40:56 +02:00
Remove unused variable; add assertion for failed semaphore creation
This commit is contained in:
@@ -15,11 +15,13 @@ class AsyncPlainLock
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
SemaphoreHandle_t _lock;
|
SemaphoreHandle_t _lock;
|
||||||
mutable void *_lockedBy;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AsyncPlainLock() {
|
AsyncPlainLock() {
|
||||||
_lock = xSemaphoreCreateBinary();
|
_lock = xSemaphoreCreateBinary();
|
||||||
|
// In this fails, the system is likely that much out of memory that
|
||||||
|
// we should abort anyways. If assertions are disabled, nothing is lost..
|
||||||
|
assert(_lock);
|
||||||
xSemaphoreGive(_lock);
|
xSemaphoreGive(_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,6 +49,9 @@ private:
|
|||||||
public:
|
public:
|
||||||
AsyncWebLock() {
|
AsyncWebLock() {
|
||||||
_lock = xSemaphoreCreateBinary();
|
_lock = xSemaphoreCreateBinary();
|
||||||
|
// In this fails, the system is likely that much out of memory that
|
||||||
|
// we should abort anyways. If assertions are disabled, nothing is lost..
|
||||||
|
assert(_lock);
|
||||||
_lockedBy = NULL;
|
_lockedBy = NULL;
|
||||||
xSemaphoreGive(_lock);
|
xSemaphoreGive(_lock);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user