1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #13438 from miri64/sock_async_event/fix/race-condition

sock_async_event: fix race-condition
This commit is contained in:
Gunar Schorcht 2020-02-21 19:04:30 +01:00 committed by GitHub
commit 8dc53cfd7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,14 +13,20 @@
* @author Martine Lenders <m.lenders@fu-berlin.de>
*/
#include "irq.h"
#include "net/sock/async/event.h"
static void _event_handler(event_t *ev)
{
sock_event_t *event = (sock_event_t *)ev;
unsigned state = irq_disable();
sock_async_flags_t _type = event->type;
event->cb.generic(event->sock, event->type);
event->type = 0;
irq_restore(state);
if (_type) {
event->cb.generic(event->sock, _type);
}
}
static inline void _cb(void *sock, sock_async_flags_t type,