aboutsummaryrefslogtreecommitdiffstats
path: root/libibex/ibex_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'libibex/ibex_internal.h')
-rw-r--r--libibex/ibex_internal.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/libibex/ibex_internal.h b/libibex/ibex_internal.h
index 0eb4b625ce..f2212799c6 100644
--- a/libibex/ibex_internal.h
+++ b/libibex/ibex_internal.h
@@ -18,6 +18,8 @@
* Boston, MA 02111-1307, USA.
*/
+#include "config.h"
+
#include <glib.h>
#include "ibex.h"
@@ -29,4 +31,21 @@ struct ibex {
struct _memcache *blocks;
struct _IBEXWord *words;
int predone;
+
+ /* sigh i hate glib's mutex stuff too */
+#ifdef ENABLE_THREADS
+ GMutex *lock;
+#endif
+
};
+
+#ifdef ENABLE_THREADS
+/*#define IBEX_LOCK(ib) (printf(__FILE__ "%d: %s: locking ibex\n", __LINE__, __FUNCTION__), g_mutex_lock(ib->lock))
+ #define IBEX_UNLOCK(ib) (printf(__FILE__ "%d: %s: unlocking ibex\n", __LINE__, __FUNCTION__), g_mutex_unlock(ib->lock))*/
+#define IBEX_LOCK(ib) (g_mutex_lock(ib->lock))
+#define IBEX_UNLOCK(ib) (g_mutex_unlock(ib->lock))
+#else
+#define IBEX_LOCK(ib)
+#define IBEX_UNLOCK(ib)
+#endif
+