Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/doitsujin/dxvk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/sync/sync_signal.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/util/sync/sync_signal.h b/src/util/sync/sync_signal.h
index cdbcae82..44f99eec 100644
--- a/src/util/sync/sync_signal.h
+++ b/src/util/sync/sync_signal.h
@@ -137,14 +137,22 @@ namespace dxvk::sync {
template<typename Fn>
void setCallback(uint64_t value, Fn&& proc) {
+ if (value <= this->value()) {
+ proc();
+ return;
+ }
+
std::unique_lock<dxvk::mutex> lock(m_mutex);
+ // Verify value is still in the future upon lock.
if (value > this->value())
m_callbacks.emplace_back(std::piecewise_construct,
std::make_tuple(value),
std::make_tuple(proc));
- else
+ else {
+ lock.unlock();
proc();
+ }
}
private: