#include <cassert>
#ifdef ETL_LOCK_REFCOUNTS
-#include <glibmm/thread.h>
+#include <synfig/mutex.h>
#endif
/* === M A C R O S ========================================================= */
private:
mutable int refcount;
#ifdef ETL_LOCK_REFCOUNTS
- mutable Glib::Mutex mutex;
+ mutable synfig::Mutex mutex;
#endif
protected:
void ref()const
{
#ifdef ETL_LOCK_REFCOUNTS
- Glib::Mutex::Lock lock(mutex);
+ synfig::Mutex::Lock lock(mutex);
#endif
assert(refcount>=0); refcount++;
}
bool unref()const
{
#ifdef ETL_LOCK_REFCOUNTS
- Glib::Mutex::Lock lock(mutex);
+ synfig::Mutex::Lock lock(mutex);
#endif
assert(refcount>0);
#ifdef ETL_SELF_DELETING_SHARED_OBJECT
refcount=-666;
#ifdef ETL_LOCK_REFCOUNTS
- lock.release();
+ mutex.unlock();
#endif
delete this;
#endif
int count()const
{
#ifdef ETL_LOCK_REFCOUNTS
- Glib::Mutex::Lock lock(mutex);
+ synfig::Mutex::Lock lock(mutex);
#endif
return refcount;
}