From 8da6a3ee43fbc4e248bdd83ce5a82feb3aef3ed6 Mon Sep 17 00:00:00 2001 From: Naim Abda Date: Tue, 4 Dec 2012 09:52:31 +0200 Subject: [PATCH] Fixes for Windows --- src/udpTracker.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/udpTracker.c b/src/udpTracker.c index 426ae9b..e3ee9f8 100644 --- a/src/udpTracker.c +++ b/src/udpTracker.c @@ -68,8 +68,12 @@ void UDPTracker_destroy (udpServerInstance *usi) int i; for (i = 0;i < usi->thread_count;i++) { +#ifdef WIN32 + TerminateThread (usi->threads[0], 0x00); +#elif defined (linux) pthread_detach (usi->threads[i]); pthread_cancel (usi->threads[i]); +#endif printf ("Thread (%d/%u) terminated.\n", i + 1, usi->thread_count); } if (usi->conn != NULL) @@ -383,13 +387,14 @@ static void* _thread_start (void *arg) } // free (tmpBuff); - +#ifdef linux pthread_exit (NULL); +#endif return 0; } #ifdef WIN32 -static DWORD _maintainance_start (LPVOID arg); +static DWORD _maintainance_start (LPVOID arg) #elif defined (linux) static void* _maintainance_start (void *arg) #endif