DWORD WINAPI forkthreadex_r(void * arg) { struct FORK_ARG *fa = (struct FORK_ARG *)arg; pThreadFuncEx threadcode = fa->threadcodeex; pThreadFuncOwner threadcodeex = (pThreadFuncOwner)fa->threadcodeex; void *cookie = fa->arg; void *owner = fa->owner; unsigned long rc = 0; Thread_Push((HINSTANCE)threadcode, fa->owner); SetEvent(fa->hEvent); if (owner) rc = threadcodeex(owner, cookie); else rc = threadcode(cookie); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); Thread_Pop(); return rc; }
static void *_threadcode(void *a) { threadcode((int)(size_t) a); return 0; }
static DWORD WINAPI _threadcode(LPVOID a) { threadcode((int)(size_t) a); return 0; }