[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
1 changed files with 2 additions and 1 deletions

View File

@ -26,7 +26,8 @@ namespace dxvk::sync {
}
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: