feat(thread): implement SCreateThread for windows

This commit is contained in:
fallenoak 2022-12-29 14:46:59 -06:00 committed by GitHub
parent b5cef8cbee
commit 968bb5d3b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 80 additions and 2 deletions

View file

@ -3,6 +3,9 @@
#include "storm/thread/SThread.hpp"
#include <cstdint>
#if defined(WHOA_SYSTEM_WIN)
#include <windows.h>
#endif
typedef SThread SyncObjectData;
@ -10,7 +13,12 @@ struct SThreadParmBlock {
uint32_t (*threadProc)(void*);
void* threadParam;
uint32_t threadID;
#if defined(WHOA_SYSTEM_WIN)
HANDLE threadH;
#endif
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
SyncObjectData* syncObject;
#endif
};
class S_Thread {
@ -20,6 +28,9 @@ class S_Thread {
int32_t suspended;
int32_t live;
uint32_t threadId;
#if defined(WHOA_SYSTEM_WIN)
HANDLE threadH;
#endif
char name[16];
};
@ -31,7 +42,7 @@ class S_Thread {
// Static functions
#if defined(WHOA_SYSTEM_WIN)
static uint32_t s_SLaunchThread(void* threadParam);
static DWORD s_SLaunchThread(void* threadParam);
#endif
#if defined(WHOA_SYSTEM_MAC)