projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updates.
[silc.git]
/
lib
/
silcutil
/
win32
/
silcwin32thread.c
diff --git
a/lib/silcutil/win32/silcwin32thread.c
b/lib/silcutil/win32/silcwin32thread.c
index e88a09f0c4690bbfdf9f7cddad507ef43d6d79cb..6e6a90949521ab204206cdc7cd3a2a184f266fc1 100644
(file)
--- a/
lib/silcutil/win32/silcwin32thread.c
+++ b/
lib/silcutil/win32/silcwin32thread.c
@@
-49,10
+49,12
@@
unsigned __stdcall silc_thread_win32_start(void *context)
return 0;
}
return 0;
}
+#endif
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
bool waitable)
{
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
bool waitable)
{
+#ifdef SILC_THREADS
SilcWin32Thread thread;
unsigned id;
SilcWin32Thread thread;
unsigned id;
@@
-71,10
+73,16
@@
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
}
return (SilcThread)thread;
}
return (SilcThread)thread;
+#else
+ /* Call thread callback immediately */
+ (*start_func)(context);
+ return NULL;
+#endif
}
void silc_thread_exit(void *exit_value)
{
}
void silc_thread_exit(void *exit_value)
{
+#ifdef SILC_THREADS
SilcWin32Thread thread = TlsGetValue(silc_thread_tls);
if (thread) {
SilcWin32Thread thread = TlsGetValue(silc_thread_tls);
if (thread) {
@@
-89,10
+97,12
@@
void silc_thread_exit(void *exit_value)
}
_endthreadex(0);
}
_endthreadex(0);
+#endif
}
SilcThread silc_thread_self(void)
{
}
SilcThread silc_thread_self(void)
{
+#ifdef SILC_THREADS
SilcWin32Thread self = TlsGetValue(silc_thread_tls);
if (!self) {
SilcWin32Thread self = TlsGetValue(silc_thread_tls);
if (!self) {
@@
-107,10
+117,14
@@
SilcThread silc_thread_self(void)
}
return (SilcThread)self;
}
return (SilcThread)self;
+#else
+ return NULL;
+#endif
}
bool silc_thread_wait(SilcThread thread, void **exit_value)
{
}
bool silc_thread_wait(SilcThread thread, void **exit_value)
{
+#ifdef SILC_THREADS
SilcWin32Thread self = (SilcWin32Thread)thread;
SILC_LOG_DEBUG(("Waiting for thread %p", self));
SilcWin32Thread self = (SilcWin32Thread)thread;
SILC_LOG_DEBUG(("Waiting for thread %p", self));
@@
-127,6
+141,7
@@
bool silc_thread_wait(SilcThread thread, void **exit_value)
*exit_value = NULL;
return TRUE;
*exit_value = NULL;
return TRUE;
+#else
+ return FALSE;
+#endif
}
}
-
-#endif /* SILC_THREADS */