llvm::AdvisoryLock

A synchronization primitive with weak mutual exclusion guarantees.

Synopsis

Declared in <llvm/Support/AdvisoryLock.h>

class AdvisoryLock;

Description

Implementations of this interface may allow multiple threads/processes to acquire the ownership of the lock simultaneously. Typically, threads/processes waiting for the lock to be unlocked will validate that the computation was performed by the expected thread/process and re-run the computation if not.

Member Functions

NameDescription
~AdvisoryLock [destructor] [virtual]Unlocks the lock if its ownership was previously acquired by tryLock().
tryLock [virtual]Tries to acquire ownership of the lock without blocking.
unsafeUnlock [virtual]For a lock owned by someone else, unlock it.
waitForUnlockFor [virtual]For a lock owned by someone else, wait until it is unlocked.

Derived Classes

NameDescription
LockFileManager Class that manages the creation of a lock file to aid implicit coordination between different processes.