MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / StrengthenRef

Function StrengthenRef

common/internal/reference_count.h:320–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320ABSL_MUST_USE_RESULT
321inline bool StrengthenRef(const ReferenceCount& refcount) noexcept {
322 auto count = refcount.strong_refcount_.load(std::memory_order_relaxed);
323 while (true) {
324 ABSL_DCHECK_GE(count, 0);
325 ABSL_ASSUME(count >= 0);
326 if (count == 0) {
327 return false;
328 }
329 if (refcount.strong_refcount_.compare_exchange_weak(
330 count, count + 1, std::memory_order_release,
331 std::memory_order_relaxed)) {
332 return true;
333 }
334 }
335}
336
337ABSL_MUST_USE_RESULT
338inline bool StrengthenRef(

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68