Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 732 Bytes

File metadata and controls

30 lines (22 loc) · 732 Bytes
title C26166
ms.date 11/04/2016
ms.topic reference
f1_keywords
C26166
helpviewer_keywords
C26166
ms.assetid a3d21838-07da-40f6-8d2e-1ada72765af2

C26166

warning C26166: Possibly failing to acquire or to hold lock <lock> in function <func>.

Warning C26166 resembles warning C26116 except that the confidence level is lower. For example, the function may contain annotation errors.

Example

The following code shows code that will generate warning C26166.

typedef struct _DATA {
CRITICAL_SECTION cs;
} DATA;

_Acquires_lock_(p->cs) void Enter(DATA* p) {
    EnterCriticalSection(&p->cs); // OK
}

_Acquires_lock_(p->cs) void BAD(DATA* p) {} // Warning C26166