return 0;
}
+#endif
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
bool waitable)
{
+#ifdef SILC_THREADS
SilcWin32Thread thread;
unsigned id;
}
return (SilcThread)thread;
+#else
+ /* Call thread callback immediately */
+ (*start_func)(context);
+ return NULL;
+#endif
}
void silc_thread_exit(void *exit_value)
{
+#ifdef SILC_THREADS
SilcWin32Thread thread = TlsGetValue(silc_thread_tls);
if (thread) {
}
_endthreadex(0);
+#endif
}
SilcThread silc_thread_self(void)
{
+#ifdef SILC_THREADS
SilcWin32Thread self = TlsGetValue(silc_thread_tls);
if (!self) {
}
return (SilcThread)self;
+#else
+ return NULL;
+#endif
}
bool silc_thread_wait(SilcThread thread, void **exit_value)
{
+#ifdef SILC_THREADS
SilcWin32Thread self = (SilcWin32Thread)thread;
SILC_LOG_DEBUG(("Waiting for thread %p", self));
*exit_value = NULL;
return TRUE;
+#else
+ return FALSE;
+#endif
}
-
-#endif /* SILC_THREADS */