mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 10:24:12 +01:00
[dxvk] Optimize spinlock implementation
This commit is contained in:
parent
584fd870b2
commit
0224dbc371
@ -32,10 +32,8 @@ namespace dxvk::sync {
|
||||
}
|
||||
|
||||
bool try_lock() {
|
||||
uint32_t expected = 0;
|
||||
return m_lock.compare_exchange_strong(expected, 1,
|
||||
std::memory_order_acquire,
|
||||
std::memory_order_relaxed);
|
||||
return !m_lock.load()
|
||||
&& !m_lock.exchange(1, std::memory_order_acquire);
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user