From 8d9f0070883d0563cf7117cd042e358238d95259 Mon Sep 17 00:00:00 2001 From: davidxu Date: Thu, 3 Apr 2008 02:47:35 +0000 Subject: put THR_CRITICAL_LEAVE into do .. while statement. --- lib/libthr/thread/thr_private.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/libthr/thread/thr_private.h') diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index 4855b25..68b5d53 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -460,8 +460,10 @@ struct pthread { (thrd)->critical_count++ #define THR_CRITICAL_LEAVE(thrd) \ - (thrd)->critical_count--; \ - _thr_ast(thrd); + do { \ + (thrd)->critical_count--; \ + _thr_ast(thrd); \ + } while (0) #define THR_UMUTEX_TRYLOCK(thrd, lck) \ _thr_umutex_trylock((lck), TID(thrd)) -- cgit v1.1