diff options
author | Carl Hetherington <carl@carlh.net> | 2011-12-17 16:37:18 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-12-17 16:37:18 +0000 |
commit | 39f765614a7964e07c55a57ba854f8524807d6cb (patch) | |
tree | 3d3ff60e0867099f991e669044b4c5c234413917 /libs/pbd/stateful.cc | |
parent | 85b75a0ab1c3c342cde0f0cdae71fea87a57ff20 (diff) |
Clear up confusion with overloads of _frozen and frozen()
meaning different things.
git-svn-id: svn://localhost/ardour2/branches/3.0@11016 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/stateful.cc')
-rw-r--r-- | libs/pbd/stateful.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc index b2c76f452f..0cea6324f5 100644 --- a/libs/pbd/stateful.cc +++ b/libs/pbd/stateful.cc @@ -39,8 +39,8 @@ int Stateful::current_state_version = 0; int Stateful::loading_state_version = 0; Stateful::Stateful () - : _frozen (0) - , _properties (new OwnedPropertyList) + : _properties (new OwnedPropertyList) + , _stateful_frozen (0) { _extra_xml = 0; _instant_xml = 0; @@ -275,7 +275,7 @@ Stateful::send_change (const PropertyChange& what_changed) { Glib::Mutex::Lock lm (_lock); - if (_frozen) { + if (property_changes_suspended ()) { _pending_changed.add (what_changed); return; } @@ -287,7 +287,7 @@ Stateful::send_change (const PropertyChange& what_changed) void Stateful::suspend_property_changes () { - _frozen++; + g_atomic_int_add (&_stateful_frozen, 1); } void @@ -298,7 +298,7 @@ Stateful::resume_property_changes () { Glib::Mutex::Lock lm (_lock); - if (_frozen && --_frozen > 0) { + if (property_changes_suspended() && g_atomic_int_dec_and_test (&_stateful_frozen) == FALSE) { return; } |