reentrant.h (74462) | reentrant.h (106288) |
---|---|
1/*- 2 * Copyright (c) 1997,98 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by J.T. Conklin. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * POSSIBILITY OF SUCH DAMAGE. 35 * | 1/*- 2 * Copyright (c) 1997,98 The NetBSD Foundation, Inc. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to The NetBSD Foundation 6 * by J.T. Conklin. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * POSSIBILITY OF SUCH DAMAGE. 35 * |
36 * $FreeBSD: head/lib/libc/include/reentrant.h 74462 2001-03-19 12:50:13Z alfred $ | 36 * $FreeBSD: head/lib/libc/include/reentrant.h 106288 2002-11-01 09:37:17Z dfr $ |
37 */ 38 39/* 40 * Requirements: 41 * 42 * 1. The thread safe mechanism should be lightweight so the library can 43 * be used by non-threaded applications without unreasonable overhead. 44 * --- 59 unchanged lines hidden (view full) --- 104 _pthread_mutex_lock(m) 105#define mutex_unlock(m) if (__isthreaded) \ 106 _pthread_mutex_unlock(m) 107#define mutex_trylock(m) (__isthreaded ? 0 : _pthread_mutex_trylock(m)) 108 109#define cond_init(c, a, p) _pthread_cond_init(c, a) 110#define cond_signal(m) if (__isthreaded) \ 111 _pthread_cond_signal(m) | 37 */ 38 39/* 40 * Requirements: 41 * 42 * 1. The thread safe mechanism should be lightweight so the library can 43 * be used by non-threaded applications without unreasonable overhead. 44 * --- 59 unchanged lines hidden (view full) --- 104 _pthread_mutex_lock(m) 105#define mutex_unlock(m) if (__isthreaded) \ 106 _pthread_mutex_unlock(m) 107#define mutex_trylock(m) (__isthreaded ? 0 : _pthread_mutex_trylock(m)) 108 109#define cond_init(c, a, p) _pthread_cond_init(c, a) 110#define cond_signal(m) if (__isthreaded) \ 111 _pthread_cond_signal(m) |
112#define cond_broadcast(m) if (__isthreaded) \ 113 _pthread_cond_broadcast(m) |
|
112#define cond_wait(c, m) if (__isthreaded) \ 113 _pthread_cond_wait(c, m) 114 115#define rwlock_init(l, a) _pthread_rwlock_init(l, a) 116#define rwlock_rdlock(l) if (__isthreaded) \ 117 _pthread_rwlock_rdlock(l) 118#define rwlock_wrlock(l) if (__isthreaded) \ 119 _pthread_rwlock_wrlock(l) 120#define rwlock_unlock(l) if (__isthreaded) \ 121 _pthread_rwlock_unlock(l) 122 123#define thr_keycreate(k, d) _pthread_key_create(k, d) 124#define thr_setspecific(k, p) _pthread_setspecific(k, p) 125#define thr_getspecific(k) _pthread_getspecific(k) 126#define thr_sigsetmask(f, n, o) _pthread_sigmask(f, n, o) 127 128#define thr_self() _pthread_self() 129#define thr_exit(x) _pthread_exit(x) 130#define thr_main() _pthread_main_np() | 114#define cond_wait(c, m) if (__isthreaded) \ 115 _pthread_cond_wait(c, m) 116 117#define rwlock_init(l, a) _pthread_rwlock_init(l, a) 118#define rwlock_rdlock(l) if (__isthreaded) \ 119 _pthread_rwlock_rdlock(l) 120#define rwlock_wrlock(l) if (__isthreaded) \ 121 _pthread_rwlock_wrlock(l) 122#define rwlock_unlock(l) if (__isthreaded) \ 123 _pthread_rwlock_unlock(l) 124 125#define thr_keycreate(k, d) _pthread_key_create(k, d) 126#define thr_setspecific(k, p) _pthread_setspecific(k, p) 127#define thr_getspecific(k) _pthread_getspecific(k) 128#define thr_sigsetmask(f, n, o) _pthread_sigmask(f, n, o) 129 130#define thr_self() _pthread_self() 131#define thr_exit(x) _pthread_exit(x) 132#define thr_main() _pthread_main_np() |