projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'winevents-clean' of https://github.com/dechamps/tinc into 1.1
[tinc]
/
src
/
event.c
diff --git
a/src/event.c
b/src/event.c
index
5e6908f
..
f349742
100644
(file)
--- a/
src/event.c
+++ b/
src/event.c
@@
-35,7
+35,7
@@
static const long READ_EVENTS = FD_READ | FD_ACCEPT | FD_CLOSE;
static const long WRITE_EVENTS = FD_WRITE | FD_CONNECT;
static DWORD event_count = 0;
#endif
static const long WRITE_EVENTS = FD_WRITE | FD_CONNECT;
static DWORD event_count = 0;
#endif
-static
volatile
bool running;
+static bool running;
static int io_compare(const io_t *a, const io_t *b) {
#ifndef HAVE_MINGW
static int io_compare(const io_t *a, const io_t *b) {
#ifndef HAVE_MINGW
@@
-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) {
DWORD timeout_ms = tv ? (tv->tv_sec * 1000 + tv->tv_usec / 1000 + 1) : WSA_INFINITE;
if (!event_count) {
- LeaveCriticalSection(&mutex);
Sleep(timeout_ms);
Sleep(timeout_ms);
- EnterCriticalSection(&mutex);
continue;
}
continue;
}
@@
-328,9
+326,7
@@
bool event_loop(void) {
event_index++;
}
event_index++;
}
- LeaveCriticalSection(&mutex);
DWORD result = WSAWaitForMultipleEvents(event_count, events, FALSE, timeout_ms, FALSE);
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)
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;
}
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;
}
void event_exit(void) {
running = false;
}