mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-24 09:54:16 +08:00
Ref T437, FSUIPC thread assert check
This commit is contained in:
@@ -32,7 +32,9 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "blackmisc/simulation/fscommon/bcdconversions.h"
|
#include "blackmisc/simulation/fscommon/bcdconversions.h"
|
||||||
|
#include "blackmisc/threadutils.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QLatin1Char>
|
#include <QLatin1Char>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@@ -72,6 +74,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
bool CFsuipc::open(bool force)
|
bool CFsuipc::open(bool force)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||||
DWORD result;
|
DWORD result;
|
||||||
m_lastErrorMessage = "";
|
m_lastErrorMessage = "";
|
||||||
m_lastErrorIndex = 0;
|
m_lastErrorIndex = 0;
|
||||||
@@ -113,6 +116,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
void CFsuipc::close()
|
void CFsuipc::close()
|
||||||
{
|
{
|
||||||
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||||
if (m_opened)
|
if (m_opened)
|
||||||
{
|
{
|
||||||
CLogMessage(this).info("Closing FSUIPC: %1") << m_fsuipcVersion;
|
CLogMessage(this).info("Closing FSUIPC: %1") << m_fsuipcVersion;
|
||||||
@@ -142,6 +146,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
bool CFsuipc::write(const CTransponder &xpdr)
|
bool CFsuipc::write(const CTransponder &xpdr)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||||
if (!this->isOpened()) { return false; }
|
if (!this->isOpened()) { return false; }
|
||||||
|
|
||||||
// should be the same as writing via SimConnect data area
|
// should be the same as writing via SimConnect data area
|
||||||
@@ -157,6 +162,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
bool CFsuipc::write(const CWeatherGrid &weatherGrid)
|
bool CFsuipc::write(const CWeatherGrid &weatherGrid)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||||
if (!this->isOpened()) { return false; }
|
if (!this->isOpened()) { return false; }
|
||||||
|
|
||||||
this->clearAllWeather();
|
this->clearAllWeather();
|
||||||
@@ -295,6 +301,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
bool CFsuipc::read(CSimulatedAircraft &aircraft, bool cockpit, bool situation, bool aircraftParts)
|
bool CFsuipc::read(CSimulatedAircraft &aircraft, bool cockpit, bool situation, bool aircraftParts)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "Open not threadsafe");
|
||||||
DWORD dwResult = 0;
|
DWORD dwResult = 0;
|
||||||
char localFsTimeRaw[3];
|
char localFsTimeRaw[3];
|
||||||
char modelNameRaw[256];
|
char modelNameRaw[256];
|
||||||
|
|||||||
Reference in New Issue
Block a user