mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-09 06:07:05 -06:00
9.34
This commit is contained in:
committed by
Kornel Lesiński
parent
83f8ddcc5b
commit
f08f4dcc3c
27
C/Threads.c
Executable file → Normal file
27
C/Threads.c
Executable file → Normal file
@@ -1,5 +1,7 @@
|
||||
/* Threads.c -- multithreading library
|
||||
2009-09-20 : Igor Pavlov : Public domain */
|
||||
2013-11-12 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "Precomp.h"
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
#include <process.h>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user