Files
HW_Lib/sim/thread/thread.cpp
JiXieShi 8f7f72712c UP
2024-09-21 23:07:22 +08:00

18 lines
350 B
C++

#include "sim_thread.h"
#include <process.h>
SDL_Thread *ThreadCreat(Thread_Func_t func, char *name, void *pArg) {
SDL_Thread *t = SDL_CreateThread(func, name, NULL);
if (!t) {
SDL_Log("CreateThread: %s", SDL_GetError);
return nullptr;
}
return t;
}
void ThreadStop(SDL_Thread *t) {
SDL_WaitThread(t, NULL);
}