RtlAcquireResourceShared

Go to Home Page

Acquires a fat read/write for shared access, optionally waiting until access can be granted.

Syntax

BOOLEAN WINAPI RtlAcquireResourceShared (
    PRTL_RESOURCE pRes,
    BOOLEAN bWaitForAccess
)

Parameters

pRes
A pointer to the resource object to acquire for shared access
bWaitForAccess
Boolean value specifying whether the function can wait for access to be granted

Return Value

Nonzero if shared access was granted, zero if not

Remarks

Each call to this function must be balanced by a call to RtlReleaseResource.

If the calling thread already has the lock for either type of access, access is granted trivially. If there is an exclusive owner and bWaitForAccess is nonzero, the thread will be stuck for three times the timeout period before the function raises a STATUS_POSSIBLE_DEADLOCK exception.

The default timeout period is the value of Peb->CriticalSectionTimeout unless pRes->flags & 1 is nonzero, in which case the timeout is infinite.