Thread 고치기

This commit is contained in:
USW
2025-04-30 12:01:37 +09:00
parent 89633f94a2
commit cebd6bb9e9
4 changed files with 42 additions and 24 deletions

View File

@@ -16,15 +16,8 @@ Thread::~Thread() {
spdlog::critical("There is not joined thread");
std::exit(EXIT_FAILURE);
}
}
void* Thread::join() {
#ifdef _WIN32
WaitForSingleObject(handle_, INFINITE);
#elif __linux__
pthread_join(handle_, returnValue);
#endif
return returnValue;
if (returnValuePtr != nullptr)
delete returnValuePtr;
}
void Thread::detach() {