Compartir a través de


CeCreateRwLock (Compact 2013)

3/28/2014

CeCreateRwLock returns a handle to a new lock object that supports single writers and multiple readers.

Syntax

HRWLOCK
    CeCreateRwLock (
    __in DWORD dwFlags
  );

Parameters

  • dwFlags
    Unused. Callers should set dwFlags to zero.

Return Value

A handle to the newly created reader/writer lock object indicates success. CeCreateRwLock returns NULL if the lock object could not be created. To get extended error information, call GetLastError.

Remarks

A reader/writer lock is used to synchronize access to a resource. At any given time, it allows either concurrent read access for multiple threads, or exclusive write access for a single thread. In a situation where a resource is changed infrequently, a reader/writer lock provides better throughput than a simple one-at-a-time lock such as a critical section or mutex.

Requirements

Header

Cerwlock.h

Library

coredll.lib

See Also

Reference

Synchronization Functions
CeAcquireRwLock
CeDeleteRwLock
CeIsRwLockAcquired
CeReleaseRwLock