MCPcopy Create free account
hub / github.com/KDE/kdevelop / releaseWriteLock

Method releaseWriteLock

kdevplatform/language/duchain/duchainlock.cpp:155–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void DUChainLock::releaseWriteLock()
156{
157 Q_D(DUChainLock);
158
159 Q_ASSERT(currentThreadHasWriteLock());
160
161 //The order is important here, m_writerRecursion protects m_writer
162
163 //TODO: could testAndSet here
164 if (d->m_writerRecursion.loadRelaxed() == 1) {
165 d->m_writer = nullptr;
166 d->m_writerRecursion = 0;
167 } else {
168 d->m_writerRecursion.fetchAndAddOrdered(-1);
169 }
170}
171
172bool DUChainLock::currentThreadHasWriteLock() const
173{

Callers 1

unlockMethod · 0.80

Calls 1

loadRelaxedMethod · 0.80

Tested by

no test coverage detected