available; the latter is deprecated and there is some
evidence to suggest that it is broken on some glibmm
versions (around 2.31.0 ish) See, for example
https://github.com/lightspark/lightspark/issues/168
git-svn-id: svn://localhost/ardour2/branches/3.0@12094
d708f5d6-7413-0410-9779-
e7cbd77b26cf
#include <sys/stat.h>
#include <glib.h>
-
+#ifdef HAVE_GLIB_THREADS_RECMUTEX
+#include <glibmm/threads.h>
+#endif
#include "pbd/undo.h"
#include "pbd/stateful.h"
int _sort_id;
mutable gint block_notifications;
mutable gint ignore_state_changes;
+#ifdef HAVE_GLIB_THREADS_RECMUTEX
+ mutable Glib::Threads::RecMutex region_lock;
+#else
mutable Glib::RecMutex region_lock;
+#endif
std::set<boost::shared_ptr<Region> > pending_adds;
std::set<boost::shared_ptr<Region> > pending_removes;
RegionList pending_bounds;
its OK to block (for short intervals).
*/
+#ifdef HAVE_GLIB_THREADS_RECMUTEX
+ Glib::Threads::RecMutex::Lock lm (region_lock);
+#else
Glib::RecMutex::Lock rm (region_lock);
+#endif
/* Find all the regions that are involved in the bit we are reading,
and sort them by descending layer and ascending position.
its OK to block (for short intervals).
*/
+#ifdef HAVE_GLIB_THREADS_RECMUTEX
+ Glib::Threads::RecMutex::Lock rm (region_lock);
+#else
Glib::RecMutex::Lock rm (region_lock);
+#endif
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("++++++ %1 .. %2 +++++++ %3 trackers +++++++++++++++++\n",
start, start + dur, _note_trackers.size()));
void
MidiPlaylist::clear_note_trackers ()
{
+#ifdef HAVE_GLIB_THREADS_RECMUTEX
+ Glib::Threads::RecMutex::Lock rm (region_lock);
+#else
Glib::RecMutex::Lock rm (region_lock);
+#endif
for (NoteTrackers::iterator n = _note_trackers.begin(); n != _note_trackers.end(); ++n) {
delete n->second;
}
its OK to block (for short intervals).
*/
+#ifdef HAVE_GLIB_THREADS_RECMUTEX
+ Glib::Threads::RecMutex::Lock rm (region_lock);
+#else
Glib::RecMutex::Lock rm (region_lock);
+#endif
set<Evoral::Parameter> ret;
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')
+ conf.check_cxx(fragment = '#include <glibmm/threads.h>\nstatic Glib::Threads::RecMutex foo;\nint main () {}',
+ uselib = ['GLIBMM'],
+ msg = 'Checking for Glib::Threads::RecMutex',
+ mandatory = False,
+ okmsg = 'yes',
+ errmsg = 'no; using deprecated API',
+ define_name = 'HAVE_GLIB_THREADS_RECMUTEX')
+
for i in children:
sub_config_and_use(conf, i)