diff options
author | mtm <mtm@FreeBSD.org> | 2003-07-06 10:10:32 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2003-07-06 10:10:32 +0000 |
commit | d4808894e4846559ec5d35948da89927a1034b33 (patch) | |
tree | 5cafa78cb831b87996f103105197dbac29bf9d58 /lib/libthr/thread/thr_private.h | |
parent | b505b0da1eee42e0ad971581478b7a0637a486ec (diff) | |
download | FreeBSD-src-d4808894e4846559ec5d35948da89927a1034b33.zip FreeBSD-src-d4808894e4846559ec5d35948da89927a1034b33.tar.gz |
There's no need for _umtxtrylock to be a separate function.
Roll it into the pre-existing macro that's used to call it.
Diffstat (limited to 'lib/libthr/thread/thr_private.h')
-rw-r--r-- | lib/libthr/thread/thr_private.h | 8 |
1 files changed, 6 insertions, 2 deletions
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 <sys/aio.h> */ #ifdef _SYS_AIO_H_ |