nrelease - fix/improve livecd
[dragonfly.git] / sys / sys / _pthreadtypes.h
CommitLineData
4903c8a0 1/*
cf8046a9 2 * Copyright (c) 2020 The DragonFly Project. All rights reserved.
4903c8a0
HT
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
4903c8a0 12 *
cf8046a9 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
16 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
17 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
21 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
23 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4903c8a0
HT
24 * SUCH DAMAGE.
25 */
26
27#ifndef _SYS__PTHREADTYPES_H_
cf8046a9 28#define _SYS__PTHREADTYPES_H_
4903c8a0 29
cf8046a9 30#include <sys/cdefs.h>
4903c8a0
HT
31
32/*
cf8046a9 33 * Forward opaque structure definitions that do not pollute namespaces.
34 * To be used in headers where visibility is an issue.
4903c8a0 35 */
cf8046a9 36struct __pthread_s;
37struct __pthread_attr_s;
38struct __pthread_barrier_s;
39struct __pthread_barrierattr_s;
40struct __pthread_cond_s;
41struct __pthread_condattr_s;
42struct __pthread_mutex_s;
43struct __pthread_mutexattr_s;
44struct __pthread_once_s;
45struct __pthread_rwlock_s;
46struct __pthread_rwlockattr_s;
47struct __pthread_spinlock_s;
4903c8a0
HT
48
49/*
cf8046a9 50 * Basic pthread types to be used in function prototypes.
4903c8a0 51 */
a09695ba 52#ifndef _PTHREAD_T_DECLARED
cf8046a9 53typedef struct __pthread_s *pthread_t;
a09695ba 54#define _PTHREAD_T_DECLARED
55#endif
56#ifndef _PTHREAD_ATTR_T_DECLARED
cf8046a9 57typedef struct __pthread_attr_s *pthread_attr_t;
a09695ba 58#define _PTHREAD_ATTR_T_DECLARED
59#endif
cf8046a9 60typedef struct __pthread_barrier_s *pthread_barrier_t;
61typedef struct __pthread_barrierattr_s *pthread_barrierattr_t;
62typedef struct __pthread_cond_s *pthread_cond_t;
63typedef struct __pthread_condattr_s *pthread_condattr_t;
64typedef struct __pthread_mutex_s *pthread_mutex_t;
65typedef struct __pthread_mutexattr_s *pthread_mutexattr_t;
66typedef int pthread_key_t;
67typedef struct __pthread_once_s pthread_once_t;
68
69typedef struct __pthread_rwlock_s *pthread_rwlock_t;
70typedef struct __pthread_rwlockattr_s *pthread_rwlockattr_t;
71typedef struct __pthread_spinlock_s *pthread_spinlock_t;
4903c8a0
HT
72
73/*
cf8046a9 74 * Once-only structure (partly public).
4903c8a0 75 */
cf8046a9 76struct __pthread_once_s {
77 int __state;
78 void *__sparelibc_r; /* unused, kept for ABI compat */
4903c8a0
HT
79};
80
cf8046a9 81#endif /* !_SYS__PTHREADTYPES_H_ */