struct DefaultLockPolicy

Defined at line 159 of file ../../zircon/system/ulib/lockdep/include/lockdep/lock_policy.h

Default lock policy type that describes how to acquire and release a basic

mutex with no additional state or flags.

Public Methods

template <typename Lock>
void PreValidate (Lock * , State * )

Default lock policy has nothing special to do just before validation.

Defined at line 168 of file ../../zircon/system/ulib/lockdep/include/lockdep/lock_policy.h

template <typename Lock>
bool Acquire (Lock * lock, State * )

Acquires the lock by calling its Acquire method. The extra state argument

is unused.

Defined at line 173 of file ../../zircon/system/ulib/lockdep/include/lockdep/lock_policy.h

template <typename Lock>
void Release (Lock * lock, State * )

Releases the lock by calling its Release method. The extra state argument

is unused.

Defined at line 181 of file ../../zircon/system/ulib/lockdep/include/lockdep/lock_policy.h

template <typename Lock, typename = internal::EnableIfHasAssertHeld<Lock>>
void AssertHeld (const Lock & 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.

This will typically be invoked by users through the function

"AssertHeld()" declared in "guard.h".

Defined at line 194 of file ../../zircon/system/ulib/lockdep/include/lockdep/lock_policy.h

Records