]> sigrok.org Git - pulseview.git/blobdiff - pv/logging.cpp
Fix regression introduced by 2980ff2da269c9ed
[pulseview.git] / pv / logging.cpp
index 49b7d5828359962dcc0f4fbdc274865c783c826d..dea333e534489b78bae632da28ccad90c56e35bd 100644 (file)
 
 #include <QApplication>
 
+using std::lock_guard;
+
 namespace pv {
 
 Logging logging;
 
+const int Logging::MIN_BUFFER_SIZE = 10;
 const int Logging::MAX_BUFFER_SIZE = 50000;
 
 Logging::~Logging()
@@ -84,6 +87,8 @@ QString Logging::get_log() const
 
 void Logging::log(const QString &text, int source)
 {
+       lock_guard<mutex> log_lock(log_mutex_);
+
        if (buffer_.size() >= buffer_size_)
                buffer_.removeFirst();