1 _pthreadtypes.h |
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 * 4. The name of Chris Provenzano may not be used to endorse or promote |
|
15 * products derived from this software without specific prior written |
|
16 * permission. |
|
17 * |
|
18 * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND |
|
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
21 * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY |
|
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|
25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
|
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
28 * SUCH DAMAGE. |
|
29 * |
|
30 * $FreeBSD: src/sys/sys/_pthreadtypes.h,v 1.1 2005/05/31 15:18:17 rodrigc Exp $ |
|
31 */ |
|
32 |
|
33 #ifndef _SYS__PTHREADTYPES_H_ |
|
34 #define _SYS__PTHREADTYPES_H_ |
|
35 |
|
36 /* |
|
37 * Forward structure definitions. |
|
38 * |
|
39 * These are mostly opaque to the user. |
|
40 */ |
|
41 struct pthread; |
|
42 struct pthread_attr; |
|
43 struct pthread_cond; |
|
44 struct pthread_cond_attr; |
|
45 struct pthread_mutex; |
|
46 struct pthread_mutex_attr; |
|
47 struct pthread_once; |
|
48 struct pthread_rwlock; |
|
49 struct pthread_rwlockattr; |
|
50 struct pthread_barrier; |
|
51 struct pthread_barrier_attr; |
|
52 struct pthread_spinlock; |
|
53 |
|
54 /* |
|
55 * Primitive system data type definitions required by P1003.1c. |
|
56 * |
|
57 * Note that P1003.1c specifies that there are no defined comparison |
|
58 * or assignment operators for the types pthread_attr_t, pthread_cond_t, |
|
59 * pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t. |
|
60 */ |
|
61 typedef struct pthread *pthread_t; |
|
62 typedef struct pthread_attr *pthread_attr_t; |
|
63 typedef struct pthread_mutex *pthread_mutex_t; |
|
64 typedef struct pthread_mutex_attr *pthread_mutexattr_t; |
|
65 typedef struct pthread_cond *pthread_cond_t; |
|
66 typedef struct pthread_cond_attr *pthread_condattr_t; |
|
67 typedef int pthread_key_t; |
|
68 typedef struct pthread_once pthread_once_t; |
|
69 typedef struct pthread_rwlock *pthread_rwlock_t; |
|
70 typedef struct pthread_rwlockattr *pthread_rwlockattr_t; |
|
71 typedef struct pthread_barrier *pthread_barrier_t; |
|
72 typedef struct pthread_barrierattr *pthread_barrierattr_t; |
|
73 typedef struct pthread_spinlock *pthread_spinlock_t; |
|
74 |
|
75 /* |
|
76 * Additional type definitions: |
|
77 * |
|
78 * Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for |
|
79 * use in header symbols. |
|
80 */ |
|
81 typedef void *pthread_addr_t; |
|
82 typedef void *(*pthread_startroutine_t)(void *); |
|
83 |
|
84 /* |
|
85 * Once definitions. |
|
86 */ |
|
87 struct pthread_once { |
|
88 int state; |
|
89 pthread_mutex_t mutex; |
|
90 }; |
|
91 |
|
92 #endif /* ! _SYS__PTHREADTYPES_H_ */ |