C26140
警告 C26140:未定义的锁类型注释 <<在注释的> 锁类型的> 锁在锁定 <>该锁。
示例
_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;
}