From: Pekka Riikonen Date: Fri, 6 May 2005 10:49:29 +0000 (+0000) Subject: Code cleanup X-Git-Tag: silc.1.0.branch.tag.20050510~8 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=5dd696cf3e4edef69e5c5dd70d51ba887bd0f84d;p=silc.git Code cleanup --- diff --git a/lib/silcutil/win32/silcwin32thread.c b/lib/silcutil/win32/silcwin32thread.c index cdbb3d3c..7d5c62d2 100644 --- a/lib/silcutil/win32/silcwin32thread.c +++ b/lib/silcutil/win32/silcwin32thread.c @@ -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);