aemu
aemu copied to clipboard
Race condition in _actOnAcceptPacket
there is a race condition in _actOnAcceptPacket:
_spawnLocalEvent(context, ADHOC_MATCHING_EVENT_ESTABLISHED, sendermac, 0, NULL);
_spawnLocalEvent(context, ADHOC_MATCHING_EVENT_ACCEPT, sendermac, optlen, opt);
the events could be triggered in the wrong order (i.e. ESTABLISHED before
ACCEPT) if the _matchingEventThread is scheduled exactly between the 2 calls:
the event_stack is not locked and the thread could already call the event
handler with the ESTABLISHED event before the ACCEPT gets queued.
Original issue reported on code.google.com by [email protected]
on 12 Jul 2012 at 7:18