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

Method Acquire

src/leveldb/util/env_posix.cc:82–90  ·  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

80 // If another resource is available, acquire it and return true.
81 // Else return false.
82 bool Acquire() {
83 int old_acquires_allowed =
84 acquires_allowed_.fetch_sub(1, std::memory_order_relaxed);
85
86 if (old_acquires_allowed > 0) return true;
87
88 acquires_allowed_.fetch_add(1, std::memory_order_relaxed);
89 return false;
90 }
91
92 // Release a resource acquired by a previous call to Acquire() that returned
93 // true.

Callers 2

PosixRandomAccessFileMethod · 0.45
NewRandomAccessFileMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected