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

[util] Improve ticket lock implementation

Atomic fetch-and-add on unlock is not needed since no other thread can
modify the serving counter after the calling thread acquired the lock.
May slightly improve performance in games relying on ID3D10Multithread.
This commit is contained in:
Philip Rebohle 2020-01-01 13:59:46 +01:00
parent d7f4e44c24
commit 694d6c7f77

View File

@ -26,7 +26,8 @@ namespace dxvk::sync {
} }
void unlock() { void unlock() {
m_serving.fetch_add(1, std::memory_order_release); uint32_t serveNext = m_serving.load() + 1;
m_serving.store(serveNext, std::memory_order_release);
} }
private: private: