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:
@@ -21,6 +21,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CPipeEndpoint.h"
|
||||
#include "CSRWLock.h"
|
||||
#include "InputPipeProtocol.h"
|
||||
#include "input/IInputSink.h"
|
||||
|
||||
@@ -55,11 +56,11 @@ private:
|
||||
// Odd states are available. Endpoint changes and resyncs advance the state.
|
||||
std::atomic<uint64_t> m_state { 0 };
|
||||
|
||||
SRWLOCK m_queueLock = SRWLOCK_INIT;
|
||||
SRWLOCK m_connectionLock = SRWLOCK_INIT;
|
||||
HANDLE m_stopEvent = nullptr;
|
||||
HANDLE m_queueEvent = nullptr;
|
||||
HANDLE m_thread = nullptr;
|
||||
CSRWLock m_queueLock;
|
||||
CSRWLock m_connectionLock;
|
||||
HANDLE m_stopEvent = nullptr;
|
||||
HANDLE m_queueEvent = nullptr;
|
||||
HANDLE m_thread = nullptr;
|
||||
|
||||
QueueItem m_queue[QUEUE_LENGTH] = {};
|
||||
size_t m_queueHead = 0;
|
||||
|
||||
Reference in New Issue
Block a user