mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 14:15:35 +08:00
Ref T285, Ref T292 central caches only work in same thread
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include "blackmisc/applicationinfo.h"
|
#include "blackmisc/applicationinfo.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/datacache.h"
|
#include "blackmisc/datacache.h"
|
||||||
|
#include "blackmisc/threadutils.h"
|
||||||
#include "blackmisc/blackmiscexport.h"
|
#include "blackmisc/blackmiscexport.h"
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@@ -415,9 +416,11 @@ namespace BlackMisc
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! Central instance
|
//! Central instance
|
||||||
|
//! \remark can only be used in the thread created
|
||||||
static CCentralMultiSimulatorModelCachesProvider &modelCachesInstance()
|
static CCentralMultiSimulatorModelCachesProvider &modelCachesInstance()
|
||||||
{
|
{
|
||||||
static CCentralMultiSimulatorModelCachesProvider c("Central model caches provider");
|
static CCentralMultiSimulatorModelCachesProvider c("Central model caches provider");
|
||||||
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(&c), Q_FUNC_INFO, "Wrong thread");
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,9 +469,11 @@ namespace BlackMisc
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! Central instance
|
//! Central instance
|
||||||
|
//! \remark can only be used in the thread created
|
||||||
static CCentralMultiSimulatorModelSetCachesProvider &modelCachesInstance()
|
static CCentralMultiSimulatorModelSetCachesProvider &modelCachesInstance()
|
||||||
{
|
{
|
||||||
static CCentralMultiSimulatorModelSetCachesProvider c("Central model sets provider");
|
static CCentralMultiSimulatorModelSetCachesProvider c("Central model sets provider");
|
||||||
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(&c), Q_FUNC_INFO, "Wrong thread");
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user