Freigeben über


CeReleaseRwLock (Compact 2013)

3/28/2014

CeReleaseRwLock releases the calling thread's specified access to a reader/writer lock object.

Syntax

BOOL
    CeReleaseRwLock(
    __in HRWLOCK hLock,
    __in CERW_TYPE typeLock
  );

Parameters

  • hLock
    [in] Handle to a reader/writer lock created by a call to CeCreateRwLock
  • typeLock
    [in] Type of requested lock access. Specify CERW_TYPE_SHARED to release shared (read-only) lock access, or CERW_TYPE_EXCLUSIVE to release exclusive (read/write) lock access.

Return Value

TRUE indicates that the calling thread's recursion count was successfully decremented by a count of one. FALSE indicates that hLock is invalid, or that the lock is currently not owned by the calling thread. To get extended error information, call GetLastError.

Remarks

If the lock is invalid, GetLastError will return ERROR_INVALID_PARAMETER.

Once a reader/writer lock is released, any threads currently waiting for the lock to be available become signalled if current thread does not own the lock anymore (current thread recursion count for this lock is zero) or lock is being downgraded (exclusive mode on the lock is being downgraded to shared mode).

Requirements

Header

Cerwlock.h

Library

coredll.lib

See Also

Reference

Synchronization Functions
Synchronization Enumerations
CeCreateRwLock
CeAcquireRwLock
CeIsRwLockAcquired
CeDeleteRwLock