Expand Minimize
1 out of 1 rated this helpful - Rate this topic

TryAcquireSRWLockExclusive function

Attempts to acquire a slim reader/writer (SRW) lock in exclusive mode. If the call is successful, the calling thread takes ownership of the lock.

Syntax


BOOLEAN TryAcquireSRWLockExclusive(
  _Inout_  PSRWLOCK SRWLock
);

Parameters

SRWLock [in, out]

A pointer to the SRW lock.

Return value

If the lock is successfully acquired or the current thread already owns the lock, the return value is nonzero.

If another thread already owns the lock, the return value is zero.

Remarks

Windows Phone 8: This API is supported.

Requirements

Minimum supported client

Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | Windows Store apps]

Header

WinBase.h on Windows 7 and Windows Server 2008 R2 (include Windows.h);
Synchapi.h on Windows 8 and Windows Server 2012

Library

Kernel32.lib

DLL

Kernel32.dll

See also

AcquireSRWLockExclusive
Slim Reader/Writer (SRW) Locks
TryAcquireSRWLockShared

 

 

Send comments about this topic to Microsoft

Build date: 12/18/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.