#include <cassert>
#include <stdexcept>
+#include <cerrno>
#include <glib.h>
#include <glib/gstdio.h>
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <cerrno>
+
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#define __pbd_signals_h__
#include <list>
-#include <glibmm/thread.h>
+#include <map>
+#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;
};
one from another.
*/
- Glib::Mutex _lock;
+ Glib::Threads::Mutex _lock;
typedef std::list<ScopedConnection*> ConnectionList;
ConnectionList _list;
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("", 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)
*/
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)
boost::shared_ptr<Connection> _connect (slot_function_type f)
{
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);
}
};
void
ScopedConnectionList::add_connection (const UnscopedConnection& c)
{
- Glib::Mutex::Lock lm (_lock);
+ Glib::Threads::Mutex::Lock lm (_lock);
_list.push_back (new ScopedConnection (c));
}
void
ScopedConnectionList::drop_connections ()
{
- Glib::Mutex::Lock lm (_lock);
+ Glib::Threads::Mutex::Lock lm (_lock);
for (ConnectionList::iterator i = _list.begin(); i != _list.end(); ++i) {
delete *i;
autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2')
- autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0')
+ autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.30.0')
autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
autowaf.check_pkg(conf, 'giomm-2.4', uselib_store='GIOMM', atleast_version='2.2')
autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL', atleast_version='7.0.0')