static Mutex* atomicallyInitializedStaticMutex;
-static ThreadIdentifier mainThreadIdentifier;
-
static Mutex& threadMapMutex()
{
static Mutex mutex;
atomicallyInitializedStaticMutex = new Mutex;
threadMapMutex();
initializeRandomNumberGenerator();
- QThread* mainThread = QCoreApplication::instance()->thread();
- mainThreadIdentifier = identifierByQthreadHandle(mainThread);
- if (!mainThreadIdentifier)
- mainThreadIdentifier = establishIdentifierForThread(mainThread);
- initializeMainThread();
}
}
return establishIdentifierForThread(currentThread);
}
-bool isMainThread()
-{
- return QThread::currentThread() == QCoreApplication::instance()->thread();
-}
-
Mutex::Mutex()
: m_mutex(new QMutex())
{