Properly forward arguments in Win32Thread

This commit is contained in:
Robbert van der Helm
2020-10-27 18:28:23 +01:00
parent a6b5951d81
commit bafc36614b
2 changed files with 28 additions and 27 deletions
-8
View File
@@ -25,14 +25,6 @@ uint32_t WINAPI win32_thread_trampoline(std::function<void()>* entry_point) {
return 0;
}
Win32Thread::~Win32Thread() {
// Imitate std::jthread's joining behaviour, the thread handle will be
// cleaned up by the `std::unique_ptr`
if (handle) {
WaitForSingleObject(handle.get(), INFINITE);
}
}
Win32Thread::Win32Thread(Win32Thread&& o) : handle(std::move(o.handle)) {}
Win32Thread& Win32Thread::operator=(Win32Thread&& o) {