[cairo-commit] src/cairo-mutex-type-private.h

Behdad Esfahbod behdad at kemper.freedesktop.org
Sun Jun 1 12:32:51 PDT 2008


 src/cairo-mutex-type-private.h |   21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

New commits:
commit 0ea7d5d6dbd7d48f7d88280dedeba2c1bc36d1ea
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Jun 1 15:32:42 2008 -0400

    [cairo-mutex] Remove debugging stuff that I accidentally committed
    
    We should add read mutex debugging facilities when the debugging
    infrastructure is in place.

diff --git a/src/cairo-mutex-type-private.h b/src/cairo-mutex-type-private.h
index 0b258db..f940829 100644
--- a/src/cairo-mutex-type-private.h
+++ b/src/cairo-mutex-type-private.h
@@ -181,26 +181,7 @@ typedef cairo_mutex_impl_t cairo_mutex_t;
 
 #ifdef CAIRO_MUTEX_DEBUG
 
-# undef CAIRO_MUTEX_LOCK
-# undef CAIRO_MUTEX_UNLOCK
-# define CAIRO_MUTEX_LOCK(mutex)	CAIRO_MUTEX_LOG_OP(mutex, "LOCK",   CAIRO_MUTEX_IMPL_LOCK)
-# define CAIRO_MUTEX_UNLOCK(mutex)	CAIRO_MUTEX_LOG_OP(mutex, "UNLOCK", CAIRO_MUTEX_IMPL_UNLOCK)
-
-#define CAIRO_MUTEX_LOG_OP(mutex, msg, op) \
-	do { cairo_mutex_t *__m = &(mutex); CAIRO_MUTEX_LOG(__m, msg); op(*__m); } while (0)
-
-
-#include <execinfo.h>
-#define CAIRO_MUTEX_LOG(mutex, msg) CAIRO_MUTEX_LOG0(mutex, CAIRO_MUTEX_DEBUG, msg)
-#define CAIRO_MUTEX_LOG0(mutex, which, msg) if (mutex == &which) CAIRO_MUTEX_LOG1(mutex, which, msg)
-#define CAIRO_MUTEX_LOG1(mutex, which, msg) \
-	do {	\
-		void *buffer[10];	\
-		int nptrs;	\
-		fprintf (stderr, "" #which " %s\n", msg);	\
-		nptrs = backtrace(buffer, ARRAY_LENGTH (buffer));	\
-		backtrace_symbols_fd (buffer, nptrs, 2);	\
-	} while (0)
+/* TODO add mutex debugging facilities here (eg deadlock detection) */
 
 #endif /* CAIRO_MUTEX_DEBUG */
 


More information about the cairo-commit mailing list