Thread: fix compile errors

This commit is contained in:
李通洲
2022-10-14 18:13:19 +08:00
parent 4bd6f2da89
commit 3b541d3670
+3 -3
View File
@@ -14,9 +14,9 @@
typedef SRWLOCK FFThreadMutex;
static inline void ffThreadMutexLock(FFThreadMutex* mutex) { AcquireSRWLockExclusive(mutex); }
static inline void ffThreadMutexUnlock(FFThreadMutex* mutex) { ReleaseSRWLockExclusive(mutex); }
static inline void ffThreadCreateAndDetach(__stdcall unsigned (* func)(void*), void* data) {
uintptr_t newThread = _beginthreadex(func, 0, data, NULL, 0, NULL);
if(newThread != 0)
static inline void ffThreadCreateAndDetach(unsigned (__stdcall* func)(void*), void* data) {
uintptr_t newThread = _beginthreadex(NULL, 0, func, data, 0, NULL);
if(newThread)
CloseHandle((HANDLE)newThread);
}
#define FF_THREAD_ENTRY_DECL_WRAPPER(fn, paramType) static __stdcall unsigned fn ## ThreadMain (void* data) { fn((paramType)data); return 0; }