Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 687 Bytes

c26140.md

File metadata and controls

30 lines (25 loc) · 687 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Warning C26140
Warning C26140
11/04/2016
C26140
C26140
a0b521b4-0c2f-470a-8904-f7bbb8014536

Warning C26140

Undefined lock kind 'lock' in annotation 'annotation' on lock 'lock'.

Example

_Has_lock_kind_(MUTEXa) HANDLE gMutex;

struct CorrectExample
{
    _Has_lock_kind_(_Lock_kind_mutex_) HANDLE mMutex;
    _Guarded_by_(mMutex) int mData;
};

_When_(return == WAIT_OBJECT_0 || return == WAIT_ABANDONED, _Acquires_lock_(gMutex))
DWORD UndefinedLockKind() // Warning C26140
{
    DWORD result = WaitForSingleObject(gMutex, 1000);
    return result;
}