1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[dxvk] Add DxvkEvent::wait method

This commit is contained in:
Philip Rebohle 2018-07-20 11:39:24 +02:00
parent 336b3858c9
commit 0fd8019a70
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 15 additions and 0 deletions

View File

@ -26,5 +26,11 @@ namespace dxvk {
std::unique_lock<std::mutex> lock(m_mutex);
return m_status;
}
void DxvkEvent::wait() {
while (this->getStatus() != DxvkEventStatus::Signaled)
dxvk::this_thread::yield();
}
}

View File

@ -46,6 +46,15 @@ namespace dxvk {
*/
DxvkEventStatus getStatus();
/**
* \brief Waits for event to get signaled
*
* Blocks the calling thread until another
* thread calls \ref signal for the current
* revision of the event.
*/
void wait();
private:
std::mutex m_mutex;