Files
NP_Midterm/impl/Utils/Thread.cpp
2025-04-24 21:36:48 +09:00

24 lines
279 B
C++

#include "Utils/Thread.hpp"
namespace Chattr {
Thread::~Thread() {
if (!detached)
join();
}
void Thread::join() {
#ifdef _WIN32
WaitForSingleObject(handle_, INFINITE);
#elif __linux__
pthread_join(handle_, NULL);
#endif
}
void Thread::deatch() {
detached = true;
}
}