From: Joel Holdsworth Date: Fri, 17 Apr 2015 17:08:39 +0000 (+0100) Subject: Session: Converted data_mutex_ into a std::recursive_mutex X-Git-Tag: pulseview-0.3.0~206 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8524a597c3625c49cb42436c25fd9b06d9b5b06a;p=pulseview.git Session: Converted data_mutex_ into a std::recursive_mutex --- diff --git a/pv/session.cpp b/pv/session.cpp index dd78f4a1..e187a4d3 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -60,6 +60,7 @@ using std::lock_guard; using std::list; using std::map; using std::mutex; +using std::recursive_mutex; using std::set; using std::shared_ptr; using std::string; @@ -322,7 +323,7 @@ void Session::update_signals() // Create data containers for the logic data segments { - lock_guard data_lock(data_mutex_); + lock_guard data_lock(data_mutex_); if (logic_channel_count == 0) { logic_data_.reset(); @@ -480,7 +481,7 @@ void Session::feed_in_frame_begin() void Session::feed_in_logic(shared_ptr logic) { - lock_guard lock(data_mutex_); + lock_guard lock(data_mutex_); if (!logic_data_) { @@ -530,7 +531,7 @@ void Session::feed_in_logic(shared_ptr logic) void Session::feed_in_analog(shared_ptr analog) { - lock_guard lock(data_mutex_); + lock_guard lock(data_mutex_); const vector> channels = analog->channels(); const unsigned int channel_count = channels.size(); @@ -634,7 +635,7 @@ void Session::data_feed_in(shared_ptr device, case SR_DF_END: { { - lock_guard lock(data_mutex_); + lock_guard lock(data_mutex_); cur_logic_segment_.reset(); cur_analog_segments_.clear(); } diff --git a/pv/session.hpp b/pv/session.hpp index f0b4c162..90dd8237 100644 --- a/pv/session.hpp +++ b/pv/session.hpp @@ -167,7 +167,7 @@ private: mutable boost::shared_mutex signals_mutex_; std::unordered_set< std::shared_ptr > signals_; - mutable std::mutex data_mutex_; + mutable std::recursive_mutex data_mutex_; std::shared_ptr logic_data_; uint64_t cur_samplerate_; std::shared_ptr cur_logic_segment_;