MCPcopy Create free account
hub / github.com/ElementsProject/elements / Acquire

Method Acquire

src/leveldb/util/env_windows.cc:128–136  ·  view source on GitHub ↗

If another resource is available, acquire it and return true. Else return false.

Source from the content-addressed store, hash-verified

126 // If another resource is available, acquire it and return true.
127 // Else return false.
128 bool Acquire() {
129 int old_acquires_allowed =
130 acquires_allowed_.fetch_sub(1, std::memory_order_relaxed);
131
132 if (old_acquires_allowed > 0) return true;
133
134 acquires_allowed_.fetch_add(1, std::memory_order_relaxed);
135 return false;
136 }
137
138 // Release a resource acquired by a previous call to Acquire() that returned
139 // true.

Callers 1

NewRandomAccessFileMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected