Skip to content

Commit dc6e2a3

Browse files
author
Ulrich Lukas
committed
Remove unused variable; add assertion for failed semaphore creation
1 parent 344062a commit dc6e2a3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/AsyncWebSynchronization.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ class AsyncPlainLock
1515
{
1616
private:
1717
SemaphoreHandle_t _lock;
18-
mutable void *_lockedBy;
1918

2019
public:
2120
AsyncPlainLock() {
2221
_lock = xSemaphoreCreateBinary();
22+
// In this fails, the system is likely that much out of memory that
23+
// we should abort anyways. If assertions are disabled, nothing is lost..
24+
assert(_lock);
2325
xSemaphoreGive(_lock);
2426
}
2527

@@ -47,6 +49,9 @@ class AsyncWebLock
4749
public:
4850
AsyncWebLock() {
4951
_lock = xSemaphoreCreateBinary();
52+
// In this fails, the system is likely that much out of memory that
53+
// we should abort anyways. If assertions are disabled, nothing is lost..
54+
assert(_lock);
5055
_lockedBy = NULL;
5156
xSemaphoreGive(_lock);
5257
}

0 commit comments

Comments
 (0)