diff --git a/src/dxvk/dxvk_event.cpp b/src/dxvk/dxvk_event.cpp index 0f2aff70..7d6fea76 100644 --- a/src/dxvk/dxvk_event.cpp +++ b/src/dxvk/dxvk_event.cpp @@ -26,5 +26,11 @@ namespace dxvk { std::unique_lock lock(m_mutex); return m_status; } + + + void DxvkEvent::wait() { + while (this->getStatus() != DxvkEventStatus::Signaled) + dxvk::this_thread::yield(); + } } \ No newline at end of file diff --git a/src/dxvk/dxvk_event.h b/src/dxvk/dxvk_event.h index 643a06d6..d652f066 100644 --- a/src/dxvk/dxvk_event.h +++ b/src/dxvk/dxvk_event.h @@ -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;