| 37 | } |
| 38 | |
| 39 | bool 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 | |
| 57 | void unlockForegroundMutexInternal(bool duringDestruction = false) |
| 58 | { |