X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fevent.c;h=f34974206b1dac9c140105f4b67230749c5a036b;hb=313a752cb5fbf27450d34c15b0085d2d8a4147af;hp=8f15ebeadd95a3e55fdaab74d812ca93fdd9cba2;hpb=ffbc99558cae4dff876645fe205349d8c4cd7acb;p=tinc diff --git a/src/event.c b/src/event.c index 8f15ebea..f3497420 100644 --- a/src/event.c +++ b/src/event.c @@ -294,9 +294,7 @@ bool event_loop(void) { DWORD timeout_ms = tv ? (tv->tv_sec * 1000 + tv->tv_usec / 1000 + 1) : WSA_INFINITE; if (!event_count) { - LeaveCriticalSection(&mutex); Sleep(timeout_ms); - EnterCriticalSection(&mutex); continue; } @@ -328,9 +326,7 @@ bool event_loop(void) { event_index++; } - LeaveCriticalSection(&mutex); DWORD result = WSAWaitForMultipleEvents(event_count, events, FALSE, timeout_ms, FALSE); - EnterCriticalSection(&mutex); WSAEVENT event; if (result >= WSA_WAIT_EVENT_0 && result < WSA_WAIT_EVENT_0 + event_count) @@ -362,12 +358,6 @@ bool event_loop(void) { return true; } -void event_flush_output(void) { - for splay_each(io_t, io, &io_tree) - if(io->flags & IO_WRITE) - io->cb(io->data, IO_WRITE); -} - void event_exit(void) { running = false; }