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

Function tryLockForegroundMutexInternal

kdevplatform/util/foregroundlock.cpp:39–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39bool tryLockForegroundMutexInternal(int interval = 0)
40{
41 if (holderThread == QThread::currentThread()) {
42 // We already have the mutex
43 ++recursion;
44 return true;
45 } else {
46 if (internalMutex.tryLock(interval)) {
47 Q_ASSERT(recursion == 0 && holderThread == nullptr);
48 holderThread = QThread::currentThread();
49 recursion = 1;
50 return true;
51 } else {
52 return false;
53 }
54 }
55}
56
57void unlockForegroundMutexInternal(bool duringDestruction = false)
58{

Callers 2

relockMethod · 0.85
tryLockMethod · 0.85

Calls 1

tryLockMethod · 0.80

Tested by

no test coverage detected