From d4808894e4846559ec5d35948da89927a1034b33 Mon Sep 17 00:00:00 2001 From: mtm Date: Sun, 6 Jul 2003 10:10:32 +0000 Subject: There's no need for _umtxtrylock to be a separate function. Roll it into the pre-existing macro that's used to call it. --- lib/libthr/thread/thr_private.h | 8 ++++++-- 1 file changed, 6 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 dd5f543..9b118b9 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -89,7 +89,12 @@ abort(); \ } while (0) -#define THR_TRYLOCK(m) _umtxtrylock((m)) +#define THR_TRYLOCK(m, r) \ + do { \ + (r) = umtx_trylock((m), curthread->thr_id); \ + if ((r) != 0 && (r) != EBUSY) \ + abort(); \ + } while (0) #define THR_UNLOCK(m) \ do { \ @@ -785,7 +790,6 @@ void _thread_critical_enter(pthread_t); void _thread_critical_exit(pthread_t); void _thread_sigblock(); void _thread_sigunblock(); -int _umtxtrylock(struct umtx *lck); /* #include */ #ifdef _SYS_AIO_H_ -- cgit v1.1