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:
@@ -207,18 +207,18 @@ void CLGMPControl::SendCursor(const IDARG_OUT_QUERY_HWCURSOR& info,
|
||||
void CLGMPControl::SetColorTransform(
|
||||
std::shared_ptr<const D12ColorTransform> transform)
|
||||
{
|
||||
AcquireSRWLockExclusive(&m_colorTransformLock);
|
||||
m_colorTransform = std::move(transform);
|
||||
ReleaseSRWLockExclusive(&m_colorTransformLock);
|
||||
{
|
||||
CSRWExclusiveLock lock(m_colorTransformLock);
|
||||
m_colorTransform = std::move(transform);
|
||||
}
|
||||
SendColorTransform();
|
||||
}
|
||||
|
||||
std::shared_ptr<const D12ColorTransform>
|
||||
CLGMPControl::GetColorTransform() const
|
||||
{
|
||||
AcquireSRWLockShared(&m_colorTransformLock);
|
||||
CSRWSharedLock lock(m_colorTransformLock);
|
||||
std::shared_ptr<const D12ColorTransform> transform = m_colorTransform;
|
||||
ReleaseSRWLockShared(&m_colorTransformLock);
|
||||
return transform;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user