[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r34798 - in libmicrohttpd/src: include microhttpd
From: |
gnunet |
Subject: |
[GNUnet-SVN] r34798 - in libmicrohttpd/src: include microhttpd |
Date: |
Fri, 26 Dec 2014 14:28:05 +0100 |
Author: Karlson2k
Date: 2014-12-26 14:28:05 +0100 (Fri, 26 Dec 2014)
New Revision: 34798
Modified:
libmicrohttpd/src/include/platform_interface.h
libmicrohttpd/src/microhttpd/daemon.c
Log:
[W32] Use _beginthreadex() instead of CreateThread() for better compatibility
with CRT functions called in additional threads
Modified: libmicrohttpd/src/include/platform_interface.h
===================================================================
--- libmicrohttpd/src/include/platform_interface.h 2014-12-26 00:02:05 UTC
(rev 34797)
+++ libmicrohttpd/src/include/platform_interface.h 2014-12-26 13:28:05 UTC
(rev 34798)
@@ -202,8 +202,8 @@
#define MHD_THRD_RTRN_TYPE_ void*
#define MHD_THRD_CALL_SPEC_
#elif defined(MHD_USE_W32_THREADS)
-#define MHD_THRD_RTRN_TYPE_ DWORD
-#define MHD_THRD_CALL_SPEC_ WINAPI
+#define MHD_THRD_RTRN_TYPE_ unsigned
+#define MHD_THRD_CALL_SPEC_ __stdcall
#endif
#if defined(MHD_USE_POSIX_THREADS)
Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c 2014-12-26 00:02:05 UTC (rev
34797)
+++ libmicrohttpd/src/microhttpd/daemon.c 2014-12-26 13:28:05 UTC (rev
34798)
@@ -63,6 +63,7 @@
#define WIN32_LEAN_AND_MEAN 1
#endif /* !WIN32_LEAN_AND_MEAN */
#include <windows.h>
+#include <process.h>
#endif
#ifndef HAVE_ACCEPT4
@@ -1110,11 +1111,11 @@
errno = EINVAL;
return ret;
#elif defined(MHD_USE_W32_THREADS)
- DWORD threadID;
- *thread = CreateThread(NULL, daemon->thread_stack_size, start_routine,
+ unsigned threadID;
+ *thread = (HANDLE)_beginthreadex(NULL, (unsigned)daemon->thread_stack_size,
start_routine,
arg, 0, &threadID);
if (NULL == (*thread))
- return EINVAL;
+ return errno;
W32_SetThreadName(threadID, "libmicrohttpd");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r34798 - in libmicrohttpd/src: include microhttpd,
gnunet <=