Fix some data races (#890)

This commit is contained in:
Murat Seker
2020-07-22 16:43:24 +02:00
committed by GitHub
parent 6362cfcc1b
commit 126c18e003
8 changed files with 69 additions and 50 deletions

View File

@@ -18,6 +18,8 @@
#include <utils/Components.h>
#include <utils/Image.h>
#include <atomic>
class Hyperion;
class Logger;
@@ -88,7 +90,7 @@ private:
Logger *_log;
// Reflects whenever this effects should interupt (timeout or external request)
bool _interupt = false;
std::atomic<bool> _interupt {};
QSize _imageSize;
QImage _image;

View File

@@ -79,11 +79,6 @@ public:
///
const quint8 & getInstanceIndex() { return _instIndex; }
///
/// Returns the number of attached leds
///
unsigned getLedCount() const;
///
/// @brief Return the size of led grid
///
@@ -92,8 +87,6 @@ public:
/// gets the methode how image is maped to leds
const int & getLedMappingType();
int getLatchTime() const;
/// forward smoothing config
unsigned addSmoothingConfig(int settlingTime_ms, double ledUpdateFrequency_hz=25.0, unsigned updateDelay=0);
unsigned updateSmoothingConfig(unsigned id, int settlingTime_ms=200, double ledUpdateFrequency_hz=25.0, unsigned updateDelay=0);
@@ -113,6 +106,12 @@ public:
LedDevice * getActiveDevice() const;
public slots:
int getLatchTime() const;
///
/// Returns the number of attached leds
///
unsigned getLedCount() const;
///
/// @brief Register a new input by priority, the priority is not active (timeout -100 isn't muxer recognized) until you start to update the data with setInput()

View File

@@ -39,16 +39,6 @@ public:
void start();
void stop();
quint16 getPort() const { return _port; }
/// check if server has been inited
bool isInited() const { return _inited; }
///
/// @brief Set a new description, if empty the description is NotFound for clients
///
void setSSDPDescription(const QString & desc);
signals:
///
/// @emits whenever server is started or stopped (to sync with SSDPHandler)
@@ -78,6 +68,16 @@ public slots:
///
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
///
/// @brief Set a new description, if empty the description is NotFound for clients
///
void setSSDPDescription(const QString & desc);
/// check if server has been inited
bool isInited() const { return _inited; }
quint16 getPort() const { return _port; }
private:
QJsonDocument _config;
bool _useSsl;