description | title | ms.date | ms.topic | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: SRWLock Class |
SRWLock Class |
09/25/2018 |
reference |
|
|
4fa250e3-5f29-4b06-ac24-61b6c04ade93 |
Represents a slim reader/writer lock.
class SRWLock;
A slim reader/writer lock is used to synchronize access across threads to an object or resource. For more information, see Synchronization Functions.
Name | Description |
---|---|
SyncLockExclusive |
Synonym for an SRWLock object that is acquired in exclusive mode. |
SyncLockShared |
Synonym for an SRWLock object that is acquired in shared mode. |
Name | Description |
---|---|
SRWLock::SRWLock | Initializes a new instance of the SRWLock class. |
SRWLock::~SRWLock | Deinitializes an instance of the SRWLock class. |
Name | Description |
---|---|
SRWLock::LockExclusive | Acquires an SRWLock object in exclusive mode. |
SRWLock::LockShared | Acquires an SRWLock object in shared mode. |
SRWLock::TryLockExclusive | Attempts to acquire a SRWLock object in exclusive mode for the current or specified SRWLock object. |
SRWLock::TryLockShared | Attempts to acquire a SRWLock object in shared mode for the current or specified SRWLock object. |
Name | Description |
---|---|
SRWLock::SRWLock_ | Contains the underlying lock variable for the current SRWLock object. |
SRWLock
Header: corewrappers.h
Namespace: Microsoft::WRL::Wrappers
Deinitializes an instance of the SRWLock
class.
~SRWLock();
Acquires an SRWLock
object in exclusive mode.
SyncLockExclusive LockExclusive();
static SyncLockExclusive LockExclusive(
_In_ SRWLOCK* lock
);
lock
Pointer to an SRWLock
object.
An SRWLock
object in exclusive mode.
Acquires an SRWLock
object in shared mode.
SyncLockShared LockShared();
static SyncLockShared LockShared(
_In_ SRWLOCK* lock
);
lock
Pointer to an SRWLock
object.
An SRWLock
object in shared mode.
Initializes a new instance of the SRWLock
class.
SRWLock();
Contains the underlying lock variable for the current SRWLock
object.
SRWLOCK SRWLock_;
Attempts to acquire a SRWLock
object in exclusive mode for the current or specified SRWLock
object. If the call is successful, the calling thread takes ownership of the lock.
SyncLockExclusive TryLockExclusive();
static SyncLockExclusive TryLockExclusive(
_In_ SRWLOCK* lock
);
lock
Pointer to an SRWLock
object.
If successful, an SRWLock
object in exclusive mode and the calling thread takes ownership of the lock. Otherwise, an SRWLock
object whose state is invalid.
Attempts to acquire a SRWLock
object in shared mode for the current or specified SRWLock
object.
WRL_NOTHROW SyncLockShared TryLockShared();
WRL_NOTHROW static SyncLockShared TryLockShared(
_In_ SRWLOCK* lock
);
lock
Pointer to an SRWLock
object.
If successful, an SRWLock
object in shared mode and the calling thread takes ownership of the lock. Otherwise, an SRWLock
object whose state is invalid.