mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 15:11:31 +00:00
[idd] common: use CSRWLock throughout the drivers
Make CSRWLock own the native lock and provide scoped guards for shared, exclusive, early-unlock, and non-blocking use. Replace direct SRW lock management throughout the IDD, input driver, and helper while preserving the existing lock scopes.
This commit is contained in:
@@ -575,7 +575,7 @@ void CD3D12CommandQueue::WaitForIdle()
|
||||
bool CD3D12CommandQueue::Submit(CD3D12CommandSlot& slot)
|
||||
{
|
||||
bool result = false;
|
||||
AcquireSRWLockExclusive(&m_submitLock);
|
||||
CSRWExclusiveLock lock(m_submitLock);
|
||||
|
||||
do
|
||||
{
|
||||
@@ -636,7 +636,6 @@ bool CD3D12CommandQueue::Submit(CD3D12CommandSlot& slot)
|
||||
}
|
||||
while (false);
|
||||
|
||||
ReleaseSRWLockExclusive(&m_submitLock);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CSRWLock.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <wdf.h>
|
||||
#include <wrl.h>
|
||||
@@ -147,7 +149,7 @@ class CD3D12CommandQueue
|
||||
ComPtr<ID3D12CommandQueue> m_queue;
|
||||
ComPtr<ID3D12Fence > m_fence;
|
||||
UINT64 m_fenceValue = 0;
|
||||
SRWLOCK m_submitLock = SRWLOCK_INIT;
|
||||
CSRWLock m_submitLock;
|
||||
std::atomic<bool> m_failed = false;
|
||||
|
||||
CD3D12CommandSlot m_slots[MAX_SLOTS];
|
||||
|
||||
Reference in New Issue
Block a user