ExAcquireSharedWaitForExclusive

BOOLEAN
    ExAcquireSharedWaitForExclusive(

        IN PERESOURCE  Resource,
        IN BOOLEAN  Wait
        );

ExAcquireSharedWaitForExclusive acquires the given resource for shared access immediately if shared access can be granted. Optionally, the caller can wait for other thread(s) to acquire and release exclusive ownership of the resource.

Parameters

Resource
Points to the resource to be acquired for shared access.
Wait
Is set to TRUE if the caller will wait until the resource becomes available when access cannot be granted immediately.

Return Value

ExAcquireSharedWaitForExclusive returns TRUE if the requested access is granted or an exclusive owner releases the resource. This routine returns FALSE if the input Wait is FALSE and shared access cannot be granted immediately.

Comments

Whether or when the caller is given shared access to the given resource depends on the following:

Callers of ExAcquireSharedWaitForExclusive must be running at IRQL < DISPATCH_LEVEL.

See Also

ExAcquireResourceSharedLite, ExAcquireSharedStarveExclusive, ExConvertExclusiveToSharedLite, ExGetExclusiveWaiterCount, ExIsResourceAcquiredExclusiveLite, ExIsResourceAcquiredSharedLite, ExTryToAcquireResourceExclusiveLite