mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Pal event queue pop before execution.
A race condition was present if a single event was present in the event queue and the event was generating a new event.pull/13759/head
parent
237278be24
commit
23f7a187fb
|
@ -116,11 +116,13 @@ public:
|
||||||
void process()
|
void process()
|
||||||
{
|
{
|
||||||
while (_events) {
|
while (_events) {
|
||||||
EventNode *next = _events->next;
|
// pop
|
||||||
_events->event();
|
auto *event = _events;
|
||||||
_events->~EventNode();
|
_events = event->next;
|
||||||
WsfBufFree(_events);
|
// execute and delete
|
||||||
_events = next;
|
event->event();
|
||||||
|
event->~EventNode();
|
||||||
|
WsfBufFree(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue