mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
Ref T312, fixed thread safety of listeners start/stop/check
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <QFlags>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <atomic>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -586,12 +587,15 @@ namespace BlackCore
|
||||
|
||||
public slots:
|
||||
//! Start listening for the simulator to start.
|
||||
//! \threadsafe
|
||||
void start();
|
||||
|
||||
//! Stops listening.
|
||||
//! \threadsafe
|
||||
void stop();
|
||||
|
||||
//! Check simulator availability
|
||||
//! \threadsafe
|
||||
void check();
|
||||
|
||||
signals:
|
||||
@@ -617,7 +621,7 @@ namespace BlackCore
|
||||
|
||||
private:
|
||||
BlackMisc::Simulation::CSimulatorPluginInfo m_info;
|
||||
bool m_isRunning = false;
|
||||
std::atomic_bool m_isRunning { false };
|
||||
};
|
||||
|
||||
//! Factory pattern class to create instances of ISimulator
|
||||
|
||||
Reference in New Issue
Block a user