CodeQL library for C/C++
Search

Module Synchronization

Utilities for analyzing synchronization primitives, such as mutexes and semaphores.

Import path

import semmle.code.cpp.commons.Synchronization

Imports

cpp

Provides classes and predicates for working with C/C++ code.

Predicates

lockCall

Holds if call is a call that locks or tries to lock its argument arg.

mustlockCall

Holds if call is a call that always locks its argument arg.

trylockCall

Holds if call is a call that tries to lock its argument arg, but may return without success.

unlockCall

Holds if call is a call that unlocks its argument arg.

Classes

DefaultMutexType

A class or struct type that has both a lock and an unlock function candidate, and is therefore a mutex.

MutexType

A type that acts as a mutex. This class is extended below and and may be extended in Options.qll.