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

Method tryBeginWrite

src/common/classes/rwlock.h:125–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 return false;
124 }
125 bool tryBeginWrite(const char* aReason)
126 {
127 if (lock.value())
128 return false;
129 if (lock.exchangeAdd(-LOCK_WRITER_OFFSET) == 0)
130 {
131 reason(aReason);
132 return true;
133 }
134 // We stepped on somebody's toes. Fix our mistake
135 if (lock.exchangeAdd(LOCK_WRITER_OFFSET) == -LOCK_WRITER_OFFSET)
136 unblockWaiting();
137 return false;
138 }
139 void beginRead(const char* aReason)
140 {
141 if (!tryBeginRead(aReason))

Callers 2

unlockStateReadMethod · 0.80
blockingAstHandlerMethod · 0.80

Calls 3

raiseFunction · 0.85
exchangeAddMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected