4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _LIBNSL_INCLUDE_MT_H
28 #define _LIBNSL_INCLUDE_MT_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * Threading and mutual exclusion declarations of primitives used for
34 * MT operation of libnsl code.
36 * Note: These primitives are designed to achieve the effect of avoiding a
37 * deadlock possibility by an interface operation being called from
38 * a signal handler while holding a lock.
39 * Note: the sig_*() functions use the _sigoff() and _sigon() consolidation
40 * private interfaces provided by libc to defer all asynchronously
41 * generated signals for the duration of holding the lock. Unlike
42 * blocking all signals with sigprocmask() or thr_sigsetmask(),
43 * _sigoff() allows signals with default dispositions to exercise
44 * their default actions (killing the process, stopping the process).
56 extern sigset_t fillset
; /* for actually blocking all signals */
58 extern void sig_mutex_lock(mutex_t
*);
59 extern void sig_mutex_unlock(mutex_t
*);
60 extern void sig_rw_rdlock(rwlock_t
*);
61 extern void sig_rw_wrlock(rwlock_t
*);
62 extern void sig_rw_unlock(rwlock_t
*);
64 extern void _sigoff(void);
65 extern void _sigon(void);
67 extern void *thr_get_storage(pthread_key_t
*, size_t, void(*)(void *));
73 #endif /* _LIBNSL_INCLUDE_MT_H */