projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92ff2b6
)
Session: don't hold sampling_mutex_ during signal emission.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Mon, 9 Nov 2015 06:28:59 +0000
(07:28 +0100)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Mon, 9 Nov 2015 17:26:55 +0000
(18:26 +0100)
We were holding the lock while emitting capture_state_changed.
pv/session.cpp
patch
|
blob
|
history
diff --git
a/pv/session.cpp
b/pv/session.cpp
index da9c0e9bb4af998abf3a3303eb525536245b3ba9..2a794f0fb0c4af8a79b662e12b810ffdb28b510d 100644
(file)
--- 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<mutex> lock(sampling_mutex_);
- const bool changed = capture_state_ != state;
- capture_state_ = state;
+ bool changed;
+
+ {
+ lock_guard<mutex> lock(sampling_mutex_);
+ changed = capture_state_ != state;
+ capture_state_ = state;
+ }
+
if (changed)
capture_state_changed(state);
}