Code cleanup
authorPekka Riikonen <priikone@silcnet.org>
Fri, 6 May 2005 10:49:29 +0000 (10:49 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 6 May 2005 10:49:29 +0000 (10:49 +0000)
lib/silcutil/win32/silcwin32thread.c

index cdbb3d3c4950b78052de1576aa56ea1bc1a85bb6..7d5c62d2f7dde3784e1cbd6911c3f78dd0cb2d05 100644 (file)
@@ -60,7 +60,9 @@ SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
   thread->start_func = start_func;
   thread->context = context;
   thread->waitable = waitable;
-  thread->thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)silc_thread_win32_start, (void *)thread, 0, &id);
+  thread->thread =
+    CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)silc_thread_win32_start,
+                (void *)thread, 0, &id);
 
   if (!thread->thread) {
     SILC_LOG_ERROR(("Could not create new thread"));
@@ -112,7 +114,7 @@ SilcThread silc_thread_self(void)
   }
 
   return (SilcThread)self;
-#else
+       #else
   return NULL;
 #endif
 }
@@ -129,9 +131,7 @@ bool silc_thread_wait(SilcThread thread, void **exit_value)
 
   /* The thread is waitable thus we will free all memory after the
      WaitForSingleObject returns, the thread is destroyed after that. */
-
-  /* 2 sec timeout, otherwise we would run to infinite loop some cases.. */
-  if (WaitForSingleObject(self->thread, 2000) == WAIT_TIMEOUT)
+  if (WaitForSingleObject(self->thread, 2500) == WAIT_TIMEOUT)
     TerminateThread(self->thread, 0);
 
   silc_free(self);