void
PresentationInfo::unsuspend_change_signal ()
{
- Glib::Threads::Mutex::Lock lm (static_signal_lock);
-
if (g_atomic_int_get (const_cast<gint*> (&_change_signal_suspended)) == 1) {
- if (!_pending_static_changes.empty()) {
+ /* atomically grab currently pending flags */
+
+ PropertyChange pc;
+
+ {
+ Glib::Threads::Mutex::Lock lm (static_signal_lock);
+ pc = _pending_static_changes;
+ _pending_static_changes.clear ();
+ }
+
+ if (!pc.empty()) {
std::cerr << "PI change (unsuspended): ";
- for (PropertyChange::const_iterator x = _pending_static_changes.begin(); x != _pending_static_changes.end(); ++x) {
+ for (PropertyChange::const_iterator x = pc.begin(); x != pc.end(); ++x) {
std::cerr << g_quark_to_string (*x) << ',';
}
std::cerr << '\n';
* they are handling this one.
*/
- Change (_pending_static_changes); /* EMIT SIGNAL */
-
- _pending_static_changes.clear ();
+ Change (pc); /* EMIT SIGNAL */
}
g_atomic_int_add (const_cast<gint*>(&_change_signal_suspended), -1);
return;
}
- Glib::Threads::Mutex::Lock lm (static_signal_lock);
if (g_atomic_int_get (&_change_signal_suspended)) {
+ Glib::Threads::Mutex::Lock lm (static_signal_lock);
_pending_static_changes.add (what_changed);
return;
}