From: Tilman Sauerbeck Date: Mon, 9 Nov 2015 06:28:59 +0000 (+0100) Subject: Session: don't hold sampling_mutex_ during signal emission. X-Git-Tag: pulseview-0.3.0~41 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=896936e568346956c32c548c78578e7a0d4094a3;p=pulseview.git Session: don't hold sampling_mutex_ during signal emission. We were holding the lock while emitting capture_state_changed. --- diff --git a/pv/session.cpp b/pv/session.cpp index da9c0e9b..2a794f0f 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -324,9 +324,14 @@ void Session::remove_decode_signal(view::DecodeTrace *signal) void Session::set_capture_state(capture_state state) { - lock_guard lock(sampling_mutex_); - const bool changed = capture_state_ != state; - capture_state_ = state; + bool changed; + + { + lock_guard lock(sampling_mutex_); + changed = capture_state_ != state; + capture_state_ = state; + } + if (changed) capture_state_changed(state); }