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

Method tryBeginRead

src/common/classes/rwlock.h:111–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 }
110 }
111 bool tryBeginRead(const char* aReason)
112 {
113 if (lock.value() < 0)
114 return false;
115 if (lock.exchangeAdd(1) >= 0)
116 {
117 reason(aReason);
118 return true;
119 }
120 // We stepped on writer's toes. Fix our mistake
121 if (lock.exchangeAdd(-1) == 1)
122 unblockWaiting();
123 return false;
124 }
125 bool tryBeginWrite(const char* aReason)
126 {
127 if (lock.value())

Callers

nothing calls this directly

Calls 3

raiseFunction · 0.85
exchangeAddMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected