From 5d2cf1ea07ecd65f4c276e5b3cbd9e062d9361cf Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 3 Sep 2010 22:39:51 +0200 Subject: Enable debugging in mutex_try_lock too * libthreads/cthreads.h (mutex_try_lock): Call WAIT_SET_DEBUG when spin_try_lock succeeds. --- libthreads/cthreads.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libthreads') diff --git a/libthreads/cthreads.h b/libthreads/cthreads.h index 2c35e700..d937dcca 100644 --- a/libthreads/cthreads.h +++ b/libthreads/cthreads.h @@ -419,7 +419,7 @@ typedef struct mutex { #define mutex_clear(m) mutex_init(m) #define mutex_free(m) free((m)) -#define mutex_try_lock(m) spin_try_lock(&(m)->held) +#define mutex_try_lock(m) (spin_try_lock(&(m)->held) ? WAIT_SET_DEBUG(m), 1 : 0) #define mutex_lock(m) \ MACRO_BEGIN \ if (!spin_try_lock(&(m)->held)) { \ -- cgit v1.2.3