summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/C/Threads.c
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/lzma/C/Threads.c')
-rw-r--r--3rdparty/lzma/C/Threads.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/3rdparty/lzma/C/Threads.c b/3rdparty/lzma/C/Threads.c
index 68561067fe6..d3d0912da42 100644
--- a/3rdparty/lzma/C/Threads.c
+++ b/3rdparty/lzma/C/Threads.c
@@ -1,7 +1,9 @@
/* Threads.c -- multithreading library
-2009-09-20 : Igor Pavlov : Public domain */
+2014-09-21 : Igor Pavlov : Public domain */
-#ifndef _WIN32_7Z_WCE
+#include "Precomp.h"
+
+#ifndef UNDER_CE
#include <process.h>
#endif
@@ -29,14 +31,21 @@ WRes Handle_WaitObject(HANDLE h) { return (WRes)WaitForSingleObject(h, INFINITE)
WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param)
{
- unsigned threadId; /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */
- *p =
- #ifdef UNDER_CE
- CreateThread(0, 0, func, param, 0, &threadId);
- #else
- (HANDLE)_beginthreadex(NULL, 0, func, param, 0, &threadId);
- #endif
- /* maybe we must use errno here, but probably GetLastError() is also OK. */
+ /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */
+
+ #ifdef UNDER_CE
+
+ DWORD threadId;
+ *p = CreateThread(0, 0, func, param, 0, &threadId);
+
+ #else
+
+ unsigned threadId;
+ *p = (HANDLE)_beginthreadex(NULL, 0, func, param, 0, &threadId);
+
+ #endif
+
+ /* maybe we must use errno here, but probably GetLastError() is also OK. */
return HandleToWRes(*p);
}