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

Go to the documentation of this file.

1

2

3

4

5

6

7

8#ifndef LLVM_SUPPORT_LOCKFILEMANAGER_H

9#define LLVM_SUPPORT_LOCKFILEMANAGER_H

10

15#include

16#include

17#include

18

19namespace llvm {

20

21

22

23

24

25

26

31

32 struct OwnerUnknown {};

33 struct OwnedByUs {};

34 struct OwnedByAnother {

35 std::string OwnerHostName;

36 int OwnerPID;

37 };

38 std::variant<OwnerUnknown, OwnedByUs, OwnedByAnother> Owner;

39

40 LockFileManager(const LockFileManager &) = delete;

41 LockFileManager &operator=(const LockFileManager &) = delete;

42

43 static std::optional readLockFile(StringRef LockFileName);

44

45 static bool processStillExecuting(StringRef Hostname, int PID);

46

47public:

48

49 LockFileManager(StringRef FileName);

50

51

52

53

55

56

57

58

61

62

63

65

66

67 ~LockFileManager() override;

68};

69}

70

71#endif

This file defines the SmallString class.

A synchronization primitive with weak mutual exclusion guarantees.

Tagged union holding either a T or a Error.

std::error_code unsafeMaybeUnlock() override

Remove the lock file.

WaitForUnlockResult waitForUnlockFor(std::chrono::seconds MaxSeconds) override

For a shared lock, wait until the owner releases the lock.

Expected< bool > tryLock() override

Tries to acquire the lock without blocking.

SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...

StringRef - Represent a constant reference to a string, i.e.

This is an optimization pass for GlobalISel generic memory operations.

WaitForUnlockResult

Describes the result of waiting for the owner to release the lock.