9#ifndef LLVM_SUPPORT_ADVISORYLOCK_H
10#define LLVM_SUPPORT_ADVISORYLOCK_H
A synchronization primitive with weak mutual exclusion guarantees.
virtual WaitForUnlockResult waitForUnlockFor(std::chrono::seconds MaxSeconds)=0
For a lock owned by someone else, wait until it is unlocked.
virtual Expected< bool > tryLock()=0
Tries to acquire ownership of the lock without blocking.
virtual std::error_code unsafeMaybeUnlock()=0
For a lock owned by someone else, unlock it.
virtual ~AdvisoryLock()=default
Unlocks the lock if its ownership was previously acquired by tryLock().
Tagged union holding either a T or a Error.
This is an optimization pass for GlobalISel generic memory operations.
WaitForUnlockResult
Describes the result of waiting for the owner to release the lock.
@ Success
The lock was released successfully.
@ OwnerDied
Owner died while holding the lock.
@ Timeout
Reached timeout while waiting for the owner to release the lock.