WIN32 compilation error fixes.
[silc.git] / lib / silcutil / win32 / silcwin32thread.c
index d54a13e6c83088fd13ca9f8be2c359e5f7fa5d5c..9b7e4bba0b0d5cd950d5800e4dbbe0d6af863028 100644 (file)
@@ -116,7 +116,7 @@ SilcThread silc_thread_self(void)
   }
 
   return (SilcThread)self;
-       #else
+#else
   return NULL;
 #endif
 }
@@ -146,6 +146,13 @@ SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
 #endif
 }
 
+void silc_thread_yield(void)
+{
+#ifdef SILC_THREADS
+  SleepEx (0,0);
+#endif /* SILC_THREADS */
+}
+
 
 /***************************** SILC Mutex API *******************************/
 
@@ -247,7 +254,7 @@ SilcBool silc_rwlock_alloc(SilcRwLock *rwlock)
 void silc_rwlock_free(SilcRwLock rwlock)
 {
 #ifdef SILC_THREADS
-  if (mutex) {
+  if (rwlock) {
     silc_mutex_free(rwlock->mutex);
     silc_cond_free(rwlock->cond);
     silc_free(rwlock);
@@ -350,7 +357,7 @@ void silc_cond_broadcast(SilcCond cond)
 void silc_cond_wait(SilcCond cond, SilcMutex mutex)
 {
 #ifdef SILC_THREADS
-  silc_cond_timedwait(cond, mutex, NULL);
+  silc_cond_timedwait(cond, mutex, 0);
 #endif /* SILC_THREADS*/
 }