Namespaces

Enumerations

enum LockResult
Name Value
Success 0
AlreadyAcquired 1
OutOfOrder 2
InvalidNesting 3
InvalidIrqSafety 4
Reentrance 5
ShouldNotHold 6
AcquireAfterLeaf 7
MaxLockDependencies 8
DependencyExists 9

Result type that represents whether a lock attempt was successful, or if not

which check failed.

Defined at line 124 of file ../../zircon/system/ulib/lockdep/include/lockdep/common.h

enum LockFlags
Name Value
LockFlagsNone 0
LockFlagsIrqSafe (1 << 0)
LockFlagsNestable (1 << 1)
LockFlagsMultiAcquire (1 << 2)
LockFlagsLeaf (1 << 3)
LockFlagsReportingDisabled (1 << 4)
LockFlagsSingletonLock (1 << 5)
LockFlagsReAcquireFatal (1 << 6)
LockFlagsActiveListDisabled (1 << 7)
LockFlagsTrackingDisabled (1 << 8)

Flags to specify which rules to apply to a lock class during validation.

Defined at line 15 of file ../../zircon/system/ulib/lockdep/include/lockdep/lock_traits.h

enum FeatureLevel
Name Value
Disabled 0
MetadataOnly 1
Validation 2

Enumeration of supported feature levels.

Defined at line 91 of file ../../zircon/system/ulib/lockdep/include/lockdep/common.h

enum OrderedLockTag
Name Value
OrderedLock 0

Type tag to select the (private) ordered Guard constructor.

Defined at line 99 of file ../../zircon/system/ulib/lockdep/include/lockdep/guard.h

enum AssertOrderedLockTag
Name Value
AssertOrderedLock 0

Type tag to select the ordered Guard constructor for type erased locks.

Defined at line 102 of file ../../zircon/system/ulib/lockdep/include/lockdep/guard.h

enum AdoptLockTag
Name Value
AdoptLock 0

Type tag to select the adopting Guard constructor.

Defined at line 105 of file ../../zircon/system/ulib/lockdep/include/lockdep/guard.h

enum AliasedLockTag
Name Value
AliasedLock 0

Type tag to select the aliased lock Guard constructor.

Defined at line 108 of file ../../zircon/system/ulib/lockdep/include/lockdep/guard.h

enum AssertOrderedAliasedLockTag
Name Value
AssertOrderedAliasedLock 0

Type tag to select the aliased lock and ordered Guard constructor for type

erased locks.

Defined at line 112 of file ../../zircon/system/ulib/lockdep/include/lockdep/guard.h

Records

Functions

  • void SystemLockValidationError (AcquiredLockEntry * lock_entry, AcquiredLockEntry * conflicting_entry, ThreadLockState * state, void * caller_address, void * caller_frame, LockResult result)

    System-defined hook to report detected lock validation failures.

    Defined at line 44 of file ../../zircon/system/ulib/lockdep/test/lock_dep_test.cc

  • void SystemLockValidationFatal (AcquiredLockEntry * lock_entry, ThreadLockState * state, void * caller_address, void * caller_frame, LockResult result)

    System-defined hook to abort the program due to a fatal lock violation.

    Defined at line 49 of file ../../zircon/system/ulib/lockdep/test/lock_dep_test.cc

  • void SystemCircularLockDependencyDetected (ValidatorLockClassState * connected_set_root)

    System-defined hook to report detection of a circular lock dependency.

  • ThreadLockState * SystemGetThreadLockState (LockFlags lock_flags)

    Default implementation of the runtime functions supporting the thread-local

    ThreadLockState. These MUST be overridden in environments that do not support

    the C++ thread_local TLS mechanism.

    Defined at line 21 of file ../../zircon/system/ulib/lockdep/lock_dep.cc

  • void SystemInitThreadLockState (ThreadLockState * state)

    System-defined hook that initializes the ThreadLockState for the current thread.

    Defined at line 26 of file ../../zircon/system/ulib/lockdep/lock_dep.cc

  • void SystemCircularLockDependencyDetected (LockClassState * connected_set_root)

    Defined at line 53 of file ../../zircon/system/ulib/lockdep/test/lock_dep_test.cc

  • LockFlags operator| (LockFlags a, LockFlags b)

    Prevent implicit conversion to int of bitwise-or expressions involving

    LockFlags.

    Defined at line 54 of file ../../zircon/system/ulib/lockdep/include/lockdep/lock_traits.h

  • void SystemTriggerLoopDetection ()

    System-defined hook that triggers a loop detection pass. In response to this

    event the implementation must trigger a call lockdep::LoopDetectionPass() on

    a separate, dedicated or non-reentrant worker thread. Non-reentrancy is a

    hard requirement as lockdep::LoopDetectionPass() mutates non-thread safe

    state. An implementation may add hysteresis to prevent too many passes in a

    given time interval.

    Defined at line 57 of file ../../zircon/system/ulib/lockdep/test/lock_dep_test.cc

  • LockFlags operator& (LockFlags a, LockFlags b)

    Prevent implicit conversion to int of bitwise-and expressions involving

    LockFlags.

    Defined at line 61 of file ../../zircon/system/ulib/lockdep/include/lockdep/lock_traits.h

  • template <typename Lockable, typename Option = void>
    void AssertHeld (const Lockable & lock)

    Assert that the given lock is exclusively held by the current thread.

    Can be used both for runtime debugging checks, and also to help when

    thread safety analysis can't prove you are holding a lock. The underlying

    lock implementation may optimize away asserts in release builds.

    Calling this function requires that LockType has a policy implementing

    `AssertHeld`. The default policy automatically implements AssertHeld

    if the underlying lock object has an `AssertHeld` method.

    Defined at line 93 of file ../../zircon/system/ulib/lockdep/include/lockdep/guard.h

  • const char * ToString (LockResult result)

    Returns a string representation of the given LockResult.

    Defined at line 146 of file ../../zircon/system/ulib/lockdep/include/lockdep/common.h

  • void AssertNoLocksHeld ()

    Generates a fatal system report if the current thread holds any tracked locks.

    Defined at line 272 of file ../../zircon/system/ulib/lockdep/include/lockdep/thread_lock_state.h

  • void LoopDetectionPass ()

    Runs a loop detection pass to find circular lock dependencies. This must be

    invoked at some point in the future after the lock validator calls the

    system-defined SystemTriggerLoopDetection().

    Defined at line 421 of file ../../zircon/system/ulib/lockdep/include/lockdep/lock_class_state.h

  • ThreadLockState * SystemGetThreadLockState ()