|
AudRecordLib
|
#include <rtlresource.h>
Public Member Functions | |
| RtlResource () | |
| ~RtlResource () | |
| BOOLEAN | AcquireShared (BOOLEAN waitForAccess) |
| BOOLEAN | AcquireExclusive (BOOLEAN waitForAccess) |
| void | Release () |
| void | OutputDebugText () const |
Very thin RAII wrapper around the fat read/writer lock
| RtlResource::RtlResource | ( | ) |
Initialises a resource
If this is the first object initialised, the function pointers to the Rtl*Resource functions in ntdll.dll are retreived before initialisation.
| RtlResource::~RtlResource | ( | ) |
Frees the memory and handles associated with the resource
| BOOLEAN RtlResource::AcquireExclusive | ( | BOOLEAN | waitForAccess | ) |
Acquires the resource for exclusive access
Exclusive access cannot be requested if the thread already has shared access, this will lead to deadlock unless waitForAccess is FALSE
| waitForAccess | Specifies whether to block if access can't be immediately granted |
| BOOLEAN RtlResource::AcquireShared | ( | BOOLEAN | waitForAccess | ) |
Acquires the resource for shared access
Shared access can be requested if the thread already has exclusive access, the thread however retains the exclusive access state
| waitForAccess | Specifies whether to block if access can't be immediately granted |
| void RtlResource::OutputDebugText | ( | ) | const |
Outputs details about the current state of the resource to the debug output
The display is of the format:
Resource @ <address of resource>
NumberOfWaitingShared = <number>
NumberOfWaitingExclusive = <number>
NumberOfActive = <number>
| void RtlResource::Release | ( | ) |
Undoes the previous acquire operation whether shared or exclusive
1.7.5.1