mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(thread): add thread functions
This commit is contained in:
parent
d0487caba3
commit
266bdc7737
16 changed files with 523 additions and 0 deletions
36
storm/thread/S_Thread.hpp
Normal file
36
storm/thread/S_Thread.hpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef STORM_THREAD_S__THREAD_HPP
|
||||
#define STORM_THREAD_S__THREAD_HPP
|
||||
|
||||
#include "thread/SThread.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
typedef SThread SyncObjectData;
|
||||
|
||||
struct SThreadParmBlock {
|
||||
uint32_t (*threadProc)(void*);
|
||||
void* threadParam;
|
||||
uint32_t threadID;
|
||||
SyncObjectData* syncObject;
|
||||
};
|
||||
|
||||
class S_Thread {
|
||||
public:
|
||||
// Types
|
||||
struct SThreadTrack {
|
||||
int32_t suspended;
|
||||
int32_t live;
|
||||
uint32_t threadId;
|
||||
char name[16];
|
||||
};
|
||||
|
||||
// Static variables
|
||||
static int32_t s_numthreads;
|
||||
static int32_t s_maxthreads;
|
||||
static uint32_t s_threadID;
|
||||
static SThreadTrack s_threads[1024];
|
||||
|
||||
// Static functions
|
||||
static uint32_t s_SLaunchThread(void* threadParam);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue