Use a mutex to allow the TAP reader to process packets faster on Windows.
[oweals/tinc.git] / src / tincd.c
index a13e2661046f58d2ca64df3a423e1e0a1e492f17..b2e055c63834b5d28dfaa90c0c5aad329254934e 100644 (file)
@@ -115,6 +115,7 @@ static struct option const long_options[] = {
 
 #ifdef HAVE_MINGW
 static struct WSAData wsa_state;
+CRITICAL_SECTION mutex;
 #endif
 
 static void usage(bool status)
@@ -568,6 +569,8 @@ int main(int argc, char **argv)
 
 int main2(int argc, char **argv)
 {
+       InitializeCriticalSection(&mutex);
+       EnterCriticalSection(&mutex);
 #endif
 
        if(!detach())