]> sigrok.org Git - pulseview.git/blobdiff - pv/logging.hpp
Logging: Make logging thread-safe
[pulseview.git] / pv / logging.hpp
index 0be270d488d4506cbc82db3fabbc9cfb81458585..fe05c5439ecf52d30c663614c08948d1c2b9ef53 100644 (file)
 
 #include "globalsettings.hpp"
 
 
 #include "globalsettings.hpp"
 
+#include <mutex>
+
 #include <QtGlobal>
 #include <QObject>
 #include <QString>
 #include <QStringList>
 
 #include <QtGlobal>
 #include <QObject>
 #include <QString>
 #include <QStringList>
 
+using std::mutex;
+
 namespace pv {
 
 class Logging : public QObject, public GlobalSettingsInterface
 namespace pv {
 
 class Logging : public QObject, public GlobalSettingsInterface
@@ -70,6 +74,7 @@ Q_SIGNALS:
 private:
        int buffer_size_;
        QStringList buffer_;
 private:
        int buffer_size_;
        QStringList buffer_;
+       mutable mutex log_mutex_;
 };
 
 extern Logging logging;
 };
 
 extern Logging logging;