View | Details | Raw Unified | Return to bug 78907
Collapse All | Expand All

(-)src/include/pthread.h (-56 / +1 lines)
Lines 44-49 Link Here
44
#include <sys/signal.h>
44
#include <sys/signal.h>
45
#include <limits.h>
45
#include <limits.h>
46
#include <sched.h>
46
#include <sched.h>
47
#include <sys/_pthreadtypes.h>
47
48
48
/*
49
/*
49
 * Run-time invariant values:
50
 * Run-time invariant values:
Lines 81-142 Link Here
81
#define PTHREAD_CANCEL_DEFERRED		0
82
#define PTHREAD_CANCEL_DEFERRED		0
82
#define PTHREAD_CANCEL_ASYNCHRONOUS	2
83
#define PTHREAD_CANCEL_ASYNCHRONOUS	2
83
#define PTHREAD_CANCELED		((void *) 1)
84
#define PTHREAD_CANCELED		((void *) 1)
84
85
/*
86
 * Forward structure definitions.
87
 *
88
 * These are mostly opaque to the user.
89
 */
90
struct pthread;
91
struct pthread_attr;
92
struct pthread_cond;
93
struct pthread_cond_attr;
94
struct pthread_mutex;
95
struct pthread_mutex_attr;
96
struct pthread_once;
97
struct pthread_rwlock;
98
struct pthread_rwlockattr;
99
struct pthread_barrier;
100
struct pthread_barrier_attr;
101
struct pthread_spinlock;
102
103
/*
104
 * Primitive system data type definitions required by P1003.1c.
105
 *
106
 * Note that P1003.1c specifies that there are no defined comparison
107
 * or assignment operators for the types pthread_attr_t, pthread_cond_t,
108
 * pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t.
109
 */
110
typedef struct	pthread			*pthread_t;
111
typedef struct	pthread_attr		*pthread_attr_t;
112
typedef struct	pthread_mutex		*pthread_mutex_t;
113
typedef struct	pthread_mutex_attr	*pthread_mutexattr_t;
114
typedef struct	pthread_cond		*pthread_cond_t;
115
typedef struct	pthread_cond_attr	*pthread_condattr_t;
116
typedef int     			pthread_key_t;
117
typedef struct	pthread_once		pthread_once_t;
118
typedef struct	pthread_rwlock		*pthread_rwlock_t;
119
typedef struct	pthread_rwlockattr	*pthread_rwlockattr_t;
120
typedef struct	pthread_barrier		*pthread_barrier_t;
121
typedef struct	pthread_barrierattr	*pthread_barrierattr_t;
122
typedef struct	pthread_spinlock	*pthread_spinlock_t;
123
124
/*
125
 * Additional type definitions:
126
 *
127
 * Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for
128
 * use in header symbols.
129
 */
130
typedef void	*pthread_addr_t;
131
typedef void	*(*pthread_startroutine_t)(void *);
132
133
/*
134
 * Once definitions.
135
 */
136
struct pthread_once {
137
	int		state;
138
	pthread_mutex_t	mutex;
139
};
140
85
141
/*
86
/*
142
 * Flags for once initialization.
87
 * Flags for once initialization.
(-)src/sys/sys/_pthreadtypes.h (+96 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
3
 * Copyright (c) 1995-1998 by John Birrell <jb@cimlogic.com.au>
4
 * All rights reserved.
5
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions
8
 * are met:
9
 * 1. Redistributions of source code must retain the above copyright
10
 *    notice, this list of conditions and the following disclaimer.
11
 * 2. Redistributions in binary form must reproduce the above copyright
12
 *    notice, this list of conditions and the following disclaimer in the
13
 *    documentation and/or other materials provided with the distribution.
14
 * 3. All advertising materials mentioning features or use of this software
15
 *    must display the following acknowledgement:
16
 *  This product includes software developed by Chris Provenzano.
17
 * 4. The name of Chris Provenzano may not be used to endorse or promote 
18
 *	  products derived from this software without specific prior written
19
 *	  permission.
20
 *
21
 * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
22
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
 * ARE DISCLAIMED.  IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY 
25
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
27
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
29
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
31
 * SUCH DAMAGE.
32
 *
33
 * $FreeBSD$
34
 */
35
36
#ifndef _SYS__PTHREADTYPES_H_
37
#define _SYS__PTHREADTYPES_H_
38
39
/*
40
 * Forward structure definitions.
41
 *
42
 * These are mostly opaque to the user.
43
 */
44
struct pthread;
45
struct pthread_attr;
46
struct pthread_cond;
47
struct pthread_cond_attr;
48
struct pthread_mutex;
49
struct pthread_mutex_attr;
50
struct pthread_once;
51
struct pthread_rwlock;
52
struct pthread_rwlockattr;
53
struct pthread_barrier;
54
struct pthread_barrier_attr;
55
struct pthread_spinlock;
56
57
/*
58
 * Primitive system data type definitions required by P1003.1c.
59
 *
60
 * Note that P1003.1c specifies that there are no defined comparison
61
 * or assignment operators for the types pthread_attr_t, pthread_cond_t,
62
 * pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t.
63
 */
64
typedef struct	pthread			*pthread_t;
65
typedef struct	pthread_attr		*pthread_attr_t;
66
typedef struct	pthread_mutex		*pthread_mutex_t;
67
typedef struct	pthread_mutex_attr	*pthread_mutexattr_t;
68
typedef struct	pthread_cond		*pthread_cond_t;
69
typedef struct	pthread_cond_attr	*pthread_condattr_t;
70
typedef int     			pthread_key_t;
71
typedef struct	pthread_once		pthread_once_t;
72
typedef struct	pthread_rwlock		*pthread_rwlock_t;
73
typedef struct	pthread_rwlockattr	*pthread_rwlockattr_t;
74
typedef struct	pthread_barrier		*pthread_barrier_t;
75
typedef struct	pthread_barrierattr	*pthread_barrierattr_t;
76
typedef struct	pthread_spinlock	*pthread_spinlock_t;
77
78
/*
79
 * Additional type definitions:
80
 *
81
 * Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for
82
 * use in header symbols.
83
 */
84
typedef void	*pthread_addr_t;
85
typedef void	*(*pthread_startroutine_t)(void *);
86
87
/*
88
 * Once definitions.
89
 */
90
struct pthread_once {
91
	int		state;
92
	pthread_mutex_t	mutex;
93
};
94
95
#endif /* _SYS__PTHREADTYPES_H_ */
96
(-)src/sys/sys/types.h (+3 lines)
Lines 44-49 Link Here
44
#include <machine/endian.h>
44
#include <machine/endian.h>
45
#include <sys/_types.h>
45
#include <sys/_types.h>
46
46
47
/* Pthread types */
48
#include <sys/_pthreadtypes.h>
49
47
#if __BSD_VISIBLE
50
#if __BSD_VISIBLE
48
typedef	unsigned char	u_char;
51
typedef	unsigned char	u_char;
49
typedef	unsigned short	u_short;
52
typedef	unsigned short	u_short;

Return to bug 78907