From a6c2c490714dd980ac709ab228d371893ee39325 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 25 Sep 2017 19:26:40 +0200 Subject: [PATCH] port: make ep_port_ctl() thread-safe --- src/port.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/port.c b/src/port.c index 0b8b0cb..82f9bae 100644 --- a/src/port.c +++ b/src/port.c @@ -285,7 +285,9 @@ int ep_port_ctl(ep_port_t* port_info, struct epoll_event* ev) { int result; + EnterCriticalSection(&port_info->lock); result = _ep_port_ctl_op(port_info, op, sock, ev); + LeaveCriticalSection(&port_info->lock); return result; }