LLVM: include/llvm/Support/AdvisoryLock.h Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9#ifndef LLVM_SUPPORT_ADVISORYLOCK_H

10#define LLVM_SUPPORT_ADVISORYLOCK_H

11

13

14#include

15

16namespace llvm {

17

26

27

28

29

30

31

32

34public:

35

36

37

38

39

41

42

43

44

47

48

49

50

52

53

55};

56}

57

58#endif

A synchronization primitive with weak mutual exclusion guarantees.

Definition AdvisoryLock.h:33

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.

Definition AdvisoryLock.h:18

@ Success

The lock was released successfully.

Definition AdvisoryLock.h:20

@ OwnerDied

Owner died while holding the lock.

Definition AdvisoryLock.h:22

@ Timeout

Reached timeout while waiting for the owner to release the lock.

Definition AdvisoryLock.h:24