mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-19 18:03:56 +02:00
Add an explicit wait to our thread wrapper
This commit is contained in:
@@ -42,6 +42,12 @@ Win32Thread& Win32Thread::operator=(Win32Thread&& o) {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Win32Thread::wait() {
|
||||||
|
if (handle) {
|
||||||
|
WaitForSingleObject(handle.get(), INFINITE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Win32Thread::Win32Thread() : handle(nullptr, nullptr) {}
|
Win32Thread::Win32Thread() : handle(nullptr, nullptr) {}
|
||||||
|
|
||||||
Win32Timer::Win32Timer(HWND window_handle,
|
Win32Timer::Win32Timer(HWND window_handle,
|
||||||
|
|||||||
@@ -184,6 +184,12 @@ class Win32Thread {
|
|||||||
Win32Thread(Win32Thread&&);
|
Win32Thread(Win32Thread&&);
|
||||||
Win32Thread& operator=(Win32Thread&&);
|
Win32Thread& operator=(Win32Thread&&);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Threads in Win32 don't join like threads on other platforms, but it may
|
||||||
|
* still be useful to wait for a thread to terminate.
|
||||||
|
*/
|
||||||
|
void wait();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* The handle for the thread that is running, will be a null pointer if this
|
* The handle for the thread that is running, will be a null pointer if this
|
||||||
|
|||||||
Reference in New Issue
Block a user