MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / exchangeGreater

Method exchangeGreater

src/common/classes/fb_atomic.h:90–102  ·  view source on GitHub ↗

returns old value

Source from the content-addressed store, hash-verified

88
89 // returns old value
90 counter_type exchangeGreater(counter_type val)
91 {
92 while (true)
93 {
94 counter_type oldVal = counter.load(std::memory_order_acquire);
95
96 if (oldVal >= val)
97 return oldVal;
98
99 if (counter.compare_exchange_strong(oldVal, val))
100 return oldVal;
101 }
102 }
103
104 // returns old value
105 counter_type exchangeLower(counter_type val)

Callers

nothing calls this directly

Calls 2

loadMethod · 0.45

Tested by

no test coverage detected