#define __pbd_signals_h__
#include <list>
-#include <glibmm/thread.h>
+#include <map>
+
+#ifdef nil
+#undef nil
+#endif
+
+#include <glibmm/threads.h>
#include <boost/noncopyable.hpp>
#include <boost/bind.hpp>
#include <boost/bind/protect.hpp>
#include <boost/function.hpp>
-#include <boost/thread/mutex.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/optional.hpp>
virtual void disconnect (boost::shared_ptr<Connection>) = 0;
protected:
- boost::mutex _mutex;
+ Glib::Threads::Mutex _mutex;
};
class Connection : public boost::enable_shared_from_this<Connection>
void disconnect ()
{
- boost::mutex::scoped_lock lm (_mutex);
+ Glib::Threads::Mutex::Lock lm (_mutex);
if (_signal) {
_signal->disconnect (shared_from_this ());
_signal = 0;
void signal_going_away ()
{
- boost::mutex::scoped_lock lm (_mutex);
+ Glib::Threads::Mutex::Lock lm (_mutex);
_signal = 0;
}
private:
- boost::mutex _mutex;
+ Glib::Threads::Mutex _mutex;
SignalBase* _signal;
};
ScopedConnection& operator= (UnscopedConnection const & o)
{
+ if (_c == o) {
+ return *this;
+ }
+
+ disconnect ();
_c = o;
return *this;
}
one from another.
*/
- Glib::Mutex _lock;
+ Glib::Threads::Mutex _lock;
typedef std::list<ScopedConnection*> ConnectionList;
ConnectionList _list;