print("", file=f)
print("\t~Signal%d () {" % n, file=f)
- print("\t\tboost::mutex::scoped_lock lm (_mutex);", file=f)
+ print("\t\tGlib::Threads::Mutex::Lock lm (_mutex);", file=f)
print("\t\t/* Tell our connection objects that we are going away, so they don't try to call us */", file=f)
- print("\t\tfor (%sSlots::iterator i = _slots.begin(); i != _slots.end(); ++i) {" % typename, file=f)
+ print("\t\tfor (%sSlots::const_iterator i = _slots.begin(); i != _slots.end(); ++i) {" % typename, file=f)
print("\t\t\ti->first->signal_going_away ();", file=f)
print("\t\t}", file=f)
print("", file=f)
print("\t\tSlots s;", file=f)
print("\t\t{", file=f)
- print("\t\t\tboost::mutex::scoped_lock lm (_mutex);", file=f)
+ print("\t\t\tGlib::Threads::Mutex::Lock lm (_mutex);", file=f)
print("\t\t\ts = _slots;", file=f)
print("\t\t}", file=f)
print("", file=f)
if not v:
print("\t\tstd::list<R> r;", file=f)
- print("\t\tfor (%sSlots::iterator i = s.begin(); i != s.end(); ++i) {" % typename, file=f)
+ print("\t\tfor (%sSlots::const_iterator i = s.begin(); i != s.end(); ++i) {" % typename, file=f)
print("""
/* We may have just called a slot, and this may have resulted in
disconnection of other slots from us. The list copy means that
*/
bool still_there = false;
{
- boost::mutex::scoped_lock lm (_mutex);
+ Glib::Threads::Mutex::Lock lm (_mutex);
still_there = _slots.find (i->first) != _slots.end ();
}
print("""
bool empty () {
- boost::mutex::scoped_lock lm (_mutex);
+ Glib::Threads::Mutex::Lock lm (_mutex);
return _slots.empty ();
}
""", file=f)
print("""
boost::shared_ptr<Connection> _connect (slot_function_type f)
{
+#ifdef DEBUG_PBD_SIGNAL_CONNECTIONS
+ if (_debug_connection) {
+ PBD::stacktrace (std::cerr, 10);
+ }
+#endif
boost::shared_ptr<Connection> c (new Connection (this));
- boost::mutex::scoped_lock lm (_mutex);
+ Glib::Threads::Mutex::Lock lm (_mutex);
_slots[c] = f;
return c;
}""", file=f)
print("""
void disconnect (boost::shared_ptr<Connection> c)
{
- boost::mutex::scoped_lock lm (_mutex);
+ Glib::Threads::Mutex::Lock lm (_mutex);
_slots.erase (c);
}
};