MCPcopy Create free account
hub / github.com/3rdparty/libprocess / Data

Class Data

include/process/mutex.hpp:73–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72private:
73 struct Data
74 {
75 Data() : locked(false) {}
76
77 ~Data()
78 {
79 // TODO(benh): Fail promises?
80 }
81
82 // Rather than use a process to serialize access to the mutex's
83 // internal data we use a 'std::atomic_flag'.
84 std::atomic_flag lock = ATOMIC_FLAG_INIT;
85
86 // Describes the state of this mutex.
87 bool locked;
88
89 // Represents "waiters" for this lock.
90 std::queue<Promise<Nothing>> waiters;
91 };
92
93 std::shared_ptr<Data> data;
94};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected