summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
92ff2b6)
We were holding the lock while emitting capture_state_changed.
void Session::set_capture_state(capture_state state)
{
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);
}
if (changed)
capture_state_changed(state);
}