~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to system/include/libc/pthread.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  pthread.h
2
 
 *
3
 
 *  Written by Joel Sherrill <joel@OARcorp.com>.
4
 
 *
5
 
 *  COPYRIGHT (c) 1989-2010.
6
 
 *  On-Line Applications Research Corporation (OAR).
7
 
 *
8
 
 *  Permission to use, copy, modify, and distribute this software for any
9
 
 *  purpose without fee is hereby granted, provided that this entire notice
10
 
 *  is included in all copies of any software which is or includes a copy
11
 
 *  or modification of this software.
12
 
 *
13
 
 *  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
14
 
 *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION
15
 
 *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
16
 
 *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
17
 
 *
18
 
 *  $Id: pthread.h,v 1.9 2010/12/08 14:44:06 corinna Exp $
19
 
 */
20
 
 
21
 
#ifndef __PTHREAD_h
22
 
#define __PTHREAD_h
23
 
 
 
1
#ifndef _PTHREAD_H
 
2
#define _PTHREAD_H
24
3
#ifdef __cplusplus
25
4
extern "C" {
26
5
#endif
27
6
 
28
 
#include <unistd.h>
29
 
 
30
 
#if defined(_POSIX_THREADS)
31
 
 
32
 
#include <sys/types.h>
 
7
#include <features.h>
 
8
 
 
9
#define __NEED_time_t
 
10
#define __NEED_clockid_t
 
11
#define __NEED_struct_timespec
 
12
#define __NEED_sigset_t
 
13
#define __NEED_pthread_t
 
14
#define __NEED_pthread_attr_t
 
15
#define __NEED_pthread_mutexattr_t
 
16
#define __NEED_pthread_condattr_t
 
17
#define __NEED_pthread_rwlockattr_t
 
18
#define __NEED_pthread_barrierattr_t
 
19
#define __NEED_pthread_mutex_t
 
20
#define __NEED_pthread_cond_t
 
21
#define __NEED_pthread_rwlock_t
 
22
#define __NEED_pthread_barrier_t
 
23
#define __NEED_pthread_spinlock_t
 
24
#define __NEED_pthread_key_t
 
25
#define __NEED_pthread_once_t
 
26
#define __NEED_size_t
 
27
 
 
28
#include <bits/alltypes.h>
 
29
 
 
30
#include <sched.h>
33
31
#include <time.h>
34
 
#include <sched.h> /* XXX Emscripten: removed sys/ */
35
 
 
36
 
/* Register Fork Handlers */
37
 
int     _EXFUN(pthread_atfork,(void (*prepare)(void), void (*parent)(void),
38
 
                   void (*child)(void)));
39
 
          
40
 
/* Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 */
41
 
 
42
 
int     _EXFUN(pthread_mutexattr_init, (pthread_mutexattr_t *__attr));
43
 
int     _EXFUN(pthread_mutexattr_destroy, (pthread_mutexattr_t *__attr));
44
 
int     _EXFUN(pthread_mutexattr_getpshared,
45
 
                (_CONST pthread_mutexattr_t *__attr, int  *__pshared));
46
 
int     _EXFUN(pthread_mutexattr_setpshared,
47
 
                (pthread_mutexattr_t *__attr, int __pshared));
48
 
 
49
 
#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES)
50
 
 
51
 
/* Single UNIX Specification 2 Mutex Attributes types */
52
 
 
53
 
int _EXFUN(pthread_mutexattr_gettype,
54
 
                (_CONST pthread_mutexattr_t *__attr, int *__kind));
55
 
int _EXFUN(pthread_mutexattr_settype,
56
 
                (pthread_mutexattr_t *__attr, int __kind));
57
 
 
58
 
#endif
59
 
 
60
 
/* Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 */
61
 
 
62
 
int     _EXFUN(pthread_mutex_init,
63
 
        (pthread_mutex_t *__mutex, _CONST pthread_mutexattr_t *__attr));
64
 
int     _EXFUN(pthread_mutex_destroy, (pthread_mutex_t *__mutex));
65
 
 
66
 
/* This is used to statically initialize a pthread_mutex_t. Example:
67
 
  
68
 
    pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
69
 
 */
70
 
 
71
 
#define PTHREAD_MUTEX_INITIALIZER  ((pthread_mutex_t) 0xFFFFFFFF)
72
 
 
73
 
/*  Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93
74
 
    NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 */
75
 
 
76
 
int     _EXFUN(pthread_mutex_lock, (pthread_mutex_t *__mutex));
77
 
int     _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *__mutex));
78
 
int     _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *__mutex));
79
 
 
80
 
#if defined(_POSIX_TIMEOUTS)
81
 
 
82
 
int     _EXFUN(pthread_mutex_timedlock,
83
 
        (pthread_mutex_t *__mutex, _CONST struct timespec *__timeout));
84
 
 
85
 
#endif /* _POSIX_TIMEOUTS */
86
 
 
87
 
/* Condition Variable Initialization Attributes, P1003.1c/Draft 10, p. 96 */
88
 
 
89
 
int     _EXFUN(pthread_condattr_init, (pthread_condattr_t *__attr));
90
 
int     _EXFUN(pthread_condattr_destroy, (pthread_condattr_t *__attr));
91
 
int     _EXFUN(pthread_condattr_getpshared,
92
 
                (_CONST pthread_condattr_t *__attr, int *__pshared));
93
 
int     _EXFUN(pthread_condattr_setpshared,
94
 
                (pthread_condattr_t *__attr, int __pshared));
95
 
 
96
 
/* Initializing and Destroying a Condition Variable, P1003.1c/Draft 10, p. 87 */
97
 
 
98
 
int     _EXFUN(pthread_cond_init,
99
 
        (pthread_cond_t *__cond, _CONST pthread_condattr_t *__attr));
100
 
int     _EXFUN(pthread_cond_destroy, (pthread_cond_t *__mutex));
101
 
 
102
 
/* This is used to statically initialize a pthread_cond_t. Example:
103
 
  
104
 
    pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
105
 
 */
106
 
 
107
 
#define PTHREAD_COND_INITIALIZER  ((pthread_mutex_t) 0xFFFFFFFF)
108
 
 
109
 
/* Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 */
110
 
 
111
 
int     _EXFUN(pthread_cond_signal, (pthread_cond_t *__cond));
112
 
int     _EXFUN(pthread_cond_broadcast, (pthread_cond_t *__cond));
113
 
 
114
 
/* Waiting on a Condition, P1003.1c/Draft 10, p. 105 */
115
 
 
116
 
int     _EXFUN(pthread_cond_wait,
117
 
        (pthread_cond_t *__cond, pthread_mutex_t *__mutex));
118
 
 
119
 
int     _EXFUN(pthread_cond_timedwait,
120
 
                (pthread_cond_t *__cond, pthread_mutex_t *__mutex,
121
 
                _CONST struct timespec *__abstime));
122
 
 
123
 
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
124
 
 
125
 
/* Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 */
126
 
 
127
 
int     _EXFUN(pthread_attr_setscope,
128
 
                (pthread_attr_t *__attr, int __contentionscope));
129
 
int     _EXFUN(pthread_attr_getscope,
130
 
        (_CONST pthread_attr_t *__attr, int *__contentionscope));
131
 
int     _EXFUN(pthread_attr_setinheritsched,
132
 
        (pthread_attr_t *__attr, int __inheritsched));
133
 
int     _EXFUN(pthread_attr_getinheritsched,
134
 
        (_CONST pthread_attr_t *__attr, int *__inheritsched));
135
 
int     _EXFUN(pthread_attr_setschedpolicy,
136
 
        (pthread_attr_t *__attr, int __policy));
137
 
int     _EXFUN(pthread_attr_getschedpolicy,
138
 
        (_CONST pthread_attr_t *__attr, int *__policy));
139
 
 
140
 
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
141
 
 
142
 
int     _EXFUN(pthread_attr_setschedparam,
143
 
        (pthread_attr_t *__attr, _CONST struct sched_param *__param));
144
 
int     _EXFUN(pthread_attr_getschedparam,
145
 
        (_CONST pthread_attr_t *__attr, struct sched_param *__param));
146
 
 
147
 
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
148
 
 
149
 
/* Dynamic Thread Scheduling Parameters Access, P1003.1c/Draft 10, p. 124 */
150
 
 
151
 
int     _EXFUN(pthread_getschedparam,
152
 
        (pthread_t __pthread, int *__policy, struct sched_param *__param));
153
 
int     _EXFUN(pthread_setschedparam,
154
 
        (pthread_t __pthread, int __policy, struct sched_param *__param));
155
 
 
156
 
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
157
 
 
158
 
#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT)
159
 
 
160
 
/* Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 */
161
 
 
162
 
int     _EXFUN(pthread_mutexattr_setprotocol,
163
 
        (pthread_mutexattr_t *__attr, int __protocol));
164
 
int     _EXFUN(pthread_mutexattr_getprotocol,
165
 
        (_CONST pthread_mutexattr_t *__attr, int *__protocol));
166
 
int     _EXFUN(pthread_mutexattr_setprioceiling,
167
 
        (pthread_mutexattr_t *__attr, int __prioceiling));
168
 
int     _EXFUN(pthread_mutexattr_getprioceiling,
169
 
        (_CONST pthread_mutexattr_t *__attr, int *__prioceiling));
170
 
 
171
 
#endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */
172
 
 
173
 
#if defined(_POSIX_THREAD_PRIO_PROTECT)
174
 
 
175
 
/* Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131 */
176
 
 
177
 
int     _EXFUN(pthread_mutex_setprioceiling,
178
 
        (pthread_mutex_t *__mutex, int __prioceiling, int *__old_ceiling));
179
 
int     _EXFUN(pthread_mutex_getprioceiling,
180
 
        (pthread_mutex_t *__mutex, int *__prioceiling));
181
 
 
182
 
#endif /* _POSIX_THREAD_PRIO_PROTECT */
183
 
 
184
 
/* Thread Creation Attributes, P1003.1c/Draft 10, p, 140 */
185
 
 
186
 
int     _EXFUN(pthread_attr_init, (pthread_attr_t *__attr));
187
 
int     _EXFUN(pthread_attr_destroy, (pthread_attr_t *__attr));
188
 
int     _EXFUN(pthread_attr_setstack, (pthread_attr_t *attr,
189
 
        void *__stackaddr, size_t __stacksize));
190
 
int     _EXFUN(pthread_attr_getstack, (_CONST pthread_attr_t *attr,
191
 
        void **__stackaddr, size_t *__stacksize));
192
 
int     _EXFUN(pthread_attr_getstacksize,
193
 
        (_CONST pthread_attr_t *__attr, size_t *__stacksize));
194
 
int     _EXFUN(pthread_attr_setstacksize,
195
 
        (pthread_attr_t *__attr, size_t __stacksize));
196
 
int     _EXFUN(pthread_attr_getstackaddr,
197
 
        (_CONST pthread_attr_t *__attr, void **__stackaddr));
198
 
int     _EXFUN(pthread_attr_setstackaddr,
199
 
        (pthread_attr_t  *__attr, void *__stackaddr));
200
 
int     _EXFUN(pthread_attr_getdetachstate,
201
 
        (_CONST pthread_attr_t *__attr, int *__detachstate));
202
 
int     _EXFUN(pthread_attr_setdetachstate,
203
 
        (pthread_attr_t *__attr, int __detachstate));
204
 
int     _EXFUN(pthread_attr_getguardsize,
205
 
        (_CONST pthread_attr_t *__attr, size_t *__guardsize));
206
 
int     _EXFUN(pthread_attr_setguardsize,
207
 
        (pthread_attr_t *__attr, size_t __guardsize));
208
 
 
209
 
/* Thread Creation, P1003.1c/Draft 10, p. 144 */
210
 
 
211
 
int     _EXFUN(pthread_create,
212
 
        (pthread_t *__pthread, _CONST pthread_attr_t  *__attr,
213
 
        void *(*__start_routine)( void * ), void *__arg));
214
 
 
215
 
/* Wait for Thread Termination, P1003.1c/Draft 10, p. 147 */
216
 
 
217
 
int     _EXFUN(pthread_join, (pthread_t __pthread, void **__value_ptr));
218
 
 
219
 
/* Detaching a Thread, P1003.1c/Draft 10, p. 149 */
220
 
 
221
 
int     _EXFUN(pthread_detach, (pthread_t __pthread));
222
 
 
223
 
/* Thread Termination, p1003.1c/Draft 10, p. 150 */
224
 
 
225
 
void    _EXFUN(pthread_exit, (void *__value_ptr));
226
 
 
227
 
/* Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX */
228
 
 
229
 
pthread_t       _EXFUN(pthread_self, (void));
230
 
 
231
 
/* Compare Thread IDs, p1003.1c/Draft 10, p. 153 */
232
 
 
233
 
int     _EXFUN(pthread_equal, (pthread_t __t1, pthread_t __t2));
234
 
 
235
 
/* Dynamic Package Initialization */
236
 
 
237
 
/* This is used to statically initialize a pthread_once_t. Example:
238
 
  
239
 
    pthread_once_t once = PTHREAD_ONCE_INIT;
240
 
  
241
 
    NOTE:  This is named inconsistently -- it should be INITIALIZER.  */
242
 
 
243
 
#define PTHREAD_ONCE_INIT  { 1, 0 }  /* is initialized and not run */
244
 
 
245
 
int     _EXFUN(pthread_once,
246
 
        (pthread_once_t *__once_control, void (*__init_routine)(void)));
247
 
 
248
 
/* Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */
249
 
 
250
 
int     _EXFUN(pthread_key_create,
251
 
        (pthread_key_t *__key, void (*__destructor)( void * )));
252
 
 
253
 
/* Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 */
254
 
 
255
 
int     _EXFUN(pthread_setspecific,
256
 
        (pthread_key_t __key, _CONST void *__value));
257
 
void *  _EXFUN(pthread_getspecific, (pthread_key_t __key));
258
 
 
259
 
/* Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 */
260
 
 
261
 
int     _EXFUN(pthread_key_delete, (pthread_key_t __key));
262
 
 
263
 
/* Execution of a Thread, P1003.1c/Draft 10, p. 181 */
264
 
 
265
 
#define PTHREAD_CANCEL_ENABLE  0
 
32
 
 
33
#define PTHREAD_CREATE_JOINABLE 0
 
34
#define PTHREAD_CREATE_DETACHED 1
 
35
 
 
36
#define PTHREAD_MUTEX_NORMAL 0
 
37
#define PTHREAD_MUTEX_DEFAULT 0
 
38
#define PTHREAD_MUTEX_RECURSIVE 1
 
39
#define PTHREAD_MUTEX_ERRORCHECK 2
 
40
 
 
41
#define PTHREAD_MUTEX_STALLED 0
 
42
#define PTHREAD_MUTEX_ROBUST 1
 
43
 
 
44
#define PTHREAD_PRIO_NONE 0
 
45
#define PTHREAD_PRIO_INHERIT 1
 
46
#define PTHREAD_PRIO_PROTECT 2
 
47
 
 
48
#define PTHREAD_INHERIT_SCHED 0
 
49
#define PTHREAD_EXPLICIT_SCHED 1
 
50
 
 
51
#define PTHREAD_SCOPE_SYSTEM 0
 
52
#define PTHREAD_SCOPE_PROCESS 1
 
53
 
 
54
#define PTHREAD_PROCESS_PRIVATE 0
 
55
#define PTHREAD_PROCESS_SHARED 1
 
56
 
 
57
 
 
58
#define PTHREAD_MUTEX_INITIALIZER {{{0}}}
 
59
#define PTHREAD_RWLOCK_INITIALIZER {{{0}}}
 
60
#define PTHREAD_COND_INITIALIZER {{{0}}}
 
61
#define PTHREAD_ONCE_INIT 0
 
62
 
 
63
 
 
64
#define PTHREAD_CANCEL_ENABLE 0
266
65
#define PTHREAD_CANCEL_DISABLE 1
267
66
 
268
67
#define PTHREAD_CANCEL_DEFERRED 0
269
68
#define PTHREAD_CANCEL_ASYNCHRONOUS 1
270
69
 
271
 
#define PTHREAD_CANCELED ((void *) -1)
272
 
 
273
 
int     _EXFUN(pthread_cancel, (pthread_t __pthread));
274
 
 
275
 
/* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */
276
 
 
277
 
int     _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate));
278
 
int     _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype));
279
 
void    _EXFUN(pthread_testcancel, (void));
280
 
 
281
 
/* Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184 */
282
 
 
283
 
void    _EXFUN(pthread_cleanup_push,
284
 
        (void (*__routine)( void * ), void *__arg));
285
 
void    _EXFUN(pthread_cleanup_pop, (int __execute));
286
 
 
287
 
#if defined(_POSIX_THREAD_CPUTIME)
288
 
 
289
 
/* Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58 */
290
 
 
291
 
int     _EXFUN(pthread_getcpuclockid,
292
 
        (pthread_t __pthread_id, clockid_t *__clock_id));
293
 
 
294
 
#endif /* defined(_POSIX_THREAD_CPUTIME) */
295
 
 
296
 
 
297
 
#endif /* defined(_POSIX_THREADS) */
298
 
 
299
 
#if defined(_POSIX_BARRIERS)
300
 
 
301
 
int     _EXFUN(pthread_barrierattr_init, (pthread_barrierattr_t *__attr));
302
 
int     _EXFUN(pthread_barrierattr_destroy, (pthread_barrierattr_t *__attr));
303
 
int     _EXFUN(pthread_barrierattr_getpshared,
304
 
        (_CONST pthread_barrierattr_t *__attr, int *__pshared));
305
 
int     _EXFUN(pthread_barrierattr_setpshared,
306
 
        (pthread_barrierattr_t *__attr, int __pshared));
307
 
 
308
 
#define PTHREAD_BARRIER_SERIAL_THREAD -1
309
 
 
310
 
int     _EXFUN(pthread_barrier_init,
311
 
        (pthread_barrier_t *__barrier,
312
 
        _CONST pthread_barrierattr_t *__attr, unsigned __count));
313
 
int     _EXFUN(pthread_barrier_destroy, (pthread_barrier_t *__barrier));
314
 
int     _EXFUN(pthread_barrier_wait,(pthread_barrier_t *__barrier));
315
 
 
316
 
#endif /* defined(_POSIX_BARRIERS) */
317
 
 
318
 
#if defined(_POSIX_SPIN_LOCKS)
319
 
 
320
 
int     _EXFUN(pthread_spin_init,
321
 
        (pthread_spinlock_t *__spinlock, int __pshared));
322
 
int     _EXFUN(pthread_spin_destroy, (pthread_spinlock_t *__spinlock));
323
 
int     _EXFUN(pthread_spin_lock, (pthread_spinlock_t *__spinlock));
324
 
int     _EXFUN(pthread_spin_trylock, (pthread_spinlock_t *__spinlock));
325
 
int     _EXFUN(pthread_spin_unlock, (pthread_spinlock_t *__spinlock));
326
 
 
327
 
#endif /* defined(_POSIX_SPIN_LOCKS) */
328
 
 
329
 
#if defined(_POSIX_READER_WRITER_LOCKS)
330
 
 
331
 
int     _EXFUN(pthread_rwlockattr_init, (pthread_rwlockattr_t *__attr));
332
 
int     _EXFUN(pthread_rwlockattr_destroy, (pthread_rwlockattr_t *__attr));
333
 
int     _EXFUN(pthread_rwlockattr_getpshared,
334
 
        (_CONST pthread_rwlockattr_t *__attr, int *__pshared));
335
 
int     _EXFUN(pthread_rwlockattr_setpshared,
336
 
        (pthread_rwlockattr_t *__attr, int __pshared));
337
 
 
338
 
int     _EXFUN(pthread_rwlock_init,
339
 
        (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr));
340
 
int     _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock));
341
 
int     _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock));
342
 
int     _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock));
343
 
int     _EXFUN(pthread_rwlock_timedrdlock,
344
 
        (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime));
345
 
int     _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock));
346
 
int     _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock));
347
 
int     _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock));
348
 
int     _EXFUN(pthread_rwlock_timedwrlock,
349
 
        (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime));
350
 
 
351
 
#endif /* defined(_POSIX_READER_WRITER_LOCKS) */
352
 
 
353
 
/* XXX Emscripten  */
354
 
int _EXFUN(pthread_getattr_np,(pthread_t __th, pthread_attr_t *__attr));
355
 
 
 
70
#define PTHREAD_CANCELED ((void *)-1)
 
71
 
 
72
 
 
73
#define PTHREAD_BARRIER_SERIAL_THREAD (-1)
 
74
 
 
75
 
 
76
int pthread_create(pthread_t *__restrict, const pthread_attr_t *__restrict, void *(*)(void *), void *__restrict);
 
77
int pthread_detach(pthread_t);
 
78
_Noreturn void pthread_exit(void *);
 
79
int pthread_join(pthread_t, void **);
 
80
 
 
81
#ifdef __GNUC__
 
82
__attribute__((const))
 
83
#endif
 
84
pthread_t pthread_self(void);
 
85
 
 
86
int pthread_equal(pthread_t, pthread_t);
 
87
#define pthread_equal(x,y) ((x)==(y))
 
88
 
 
89
int pthread_setcancelstate(int, int *);
 
90
int pthread_setcanceltype(int, int *);
 
91
void pthread_testcancel(void);
 
92
int pthread_cancel(pthread_t);
 
93
 
 
94
int pthread_getschedparam(pthread_t, int *__restrict, struct sched_param *__restrict);
 
95
int pthread_setschedparam(pthread_t, int, const struct sched_param *);
 
96
int pthread_setschedprio(pthread_t, int);
 
97
 
 
98
int pthread_once(pthread_once_t *, void (*)(void));
 
99
 
 
100
int pthread_mutex_init(pthread_mutex_t *__restrict, const pthread_mutexattr_t *__restrict);
 
101
int pthread_mutex_lock(pthread_mutex_t *);
 
102
int pthread_mutex_unlock(pthread_mutex_t *);
 
103
int pthread_mutex_trylock(pthread_mutex_t *);
 
104
int pthread_mutex_timedlock(pthread_mutex_t *__restrict, const struct timespec *__restrict);
 
105
int pthread_mutex_destroy(pthread_mutex_t *);
 
106
int pthread_mutex_consistent(pthread_mutex_t *);
 
107
 
 
108
int pthread_mutex_getprioceiling(const pthread_mutex_t *__restrict, int *__restrict);
 
109
int pthread_mutex_setprioceiling(pthread_mutex_t *__restrict, int, int *__restrict);
 
110
 
 
111
int pthread_cond_init(pthread_cond_t *__restrict, const pthread_condattr_t *__restrict);
 
112
int pthread_cond_destroy(pthread_cond_t *);
 
113
int pthread_cond_wait(pthread_cond_t *__restrict, pthread_mutex_t *__restrict);
 
114
int pthread_cond_timedwait(pthread_cond_t *__restrict, pthread_mutex_t *__restrict, const struct timespec *__restrict);
 
115
int pthread_cond_broadcast(pthread_cond_t *);
 
116
int pthread_cond_signal(pthread_cond_t *);
 
117
 
 
118
int pthread_rwlock_init(pthread_rwlock_t *__restrict, const pthread_rwlockattr_t *__restrict);
 
119
int pthread_rwlock_destroy(pthread_rwlock_t *);
 
120
int pthread_rwlock_rdlock(pthread_rwlock_t *);
 
121
int pthread_rwlock_tryrdlock(pthread_rwlock_t *);
 
122
int pthread_rwlock_timedrdlock(pthread_rwlock_t *__restrict, const struct timespec *__restrict);
 
123
int pthread_rwlock_wrlock(pthread_rwlock_t *);
 
124
int pthread_rwlock_trywrlock(pthread_rwlock_t *);
 
125
int pthread_rwlock_timedwrlock(pthread_rwlock_t *__restrict, const struct timespec *__restrict);
 
126
int pthread_rwlock_unlock(pthread_rwlock_t *);
 
127
 
 
128
int pthread_spin_init(pthread_spinlock_t *, int);
 
129
int pthread_spin_destroy(pthread_spinlock_t *);
 
130
int pthread_spin_lock(pthread_spinlock_t *);
 
131
int pthread_spin_trylock(pthread_spinlock_t *);
 
132
int pthread_spin_unlock(pthread_spinlock_t *);
 
133
 
 
134
int pthread_barrier_init(pthread_barrier_t *__restrict, const pthread_barrierattr_t *__restrict, unsigned);
 
135
int pthread_barrier_destroy(pthread_barrier_t *);
 
136
int pthread_barrier_wait(pthread_barrier_t *);
 
137
 
 
138
int pthread_key_create(pthread_key_t *, void (*)(void *));
 
139
int pthread_key_delete(pthread_key_t);
 
140
void *pthread_getspecific(pthread_key_t);
 
141
int pthread_setspecific(pthread_key_t, const void *);
 
142
 
 
143
int pthread_attr_init(pthread_attr_t *);
 
144
int pthread_attr_destroy(pthread_attr_t *);
 
145
 
 
146
int pthread_attr_getguardsize(const pthread_attr_t *__restrict, size_t *__restrict);
 
147
int pthread_attr_setguardsize(pthread_attr_t *, size_t);
 
148
int pthread_attr_getstacksize(const pthread_attr_t *__restrict, size_t *__restrict);
 
149
int pthread_attr_setstacksize(pthread_attr_t *, size_t);
 
150
int pthread_attr_getdetachstate(const pthread_attr_t *, int *);
 
151
int pthread_attr_setdetachstate(pthread_attr_t *, int);
 
152
int pthread_attr_getstack(const pthread_attr_t *__restrict, void **__restrict, size_t *__restrict);
 
153
int pthread_attr_setstack(pthread_attr_t *, void *, size_t);
 
154
int pthread_attr_getscope(const pthread_attr_t *__restrict, int *__restrict);
 
155
int pthread_attr_setscope(pthread_attr_t *, int);
 
156
int pthread_attr_getschedpolicy(const pthread_attr_t *__restrict, int *__restrict);
 
157
int pthread_attr_setschedpolicy(pthread_attr_t *, int);
 
158
int pthread_attr_getschedparam(const pthread_attr_t *__restrict, struct sched_param *__restrict);
 
159
int pthread_attr_setschedparam(pthread_attr_t *__restrict, const struct sched_param *__restrict);
 
160
int pthread_attr_getinheritsched(const pthread_attr_t *__restrict, int *__restrict);
 
161
int pthread_attr_setinheritsched(pthread_attr_t *, int);
 
162
 
 
163
int pthread_mutexattr_destroy(pthread_mutexattr_t *);
 
164
int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict, int *__restrict);
 
165
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict, int *__restrict);
 
166
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict, int *__restrict);
 
167
int pthread_mutexattr_getrobust(const pthread_mutexattr_t *__restrict, int *__restrict);
 
168
int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict, int *__restrict);
 
169
int pthread_mutexattr_init(pthread_mutexattr_t *);
 
170
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int);
 
171
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
 
172
int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
 
173
int pthread_mutexattr_setrobust(pthread_mutexattr_t *, int);
 
174
int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
 
175
 
 
176
int pthread_condattr_init(pthread_condattr_t *);
 
177
int pthread_condattr_destroy(pthread_condattr_t *);
 
178
int pthread_condattr_setclock(pthread_condattr_t *, clockid_t);
 
179
int pthread_condattr_setpshared(pthread_condattr_t *, int);
 
180
int pthread_condattr_getclock(const pthread_condattr_t *__restrict, clockid_t *__restrict);
 
181
int pthread_condattr_getpshared(const pthread_condattr_t *__restrict, int *__restrict);
 
182
 
 
183
int pthread_rwlockattr_init(pthread_rwlockattr_t *);
 
184
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *);
 
185
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *, int);
 
186
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *__restrict, int *__restrict);
 
187
 
 
188
int pthread_barrierattr_destroy(pthread_barrierattr_t *);
 
189
int pthread_barrierattr_getpshared(const pthread_barrierattr_t *__restrict, int *__restrict);
 
190
int pthread_barrierattr_init(pthread_barrierattr_t *);
 
191
int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
 
192
 
 
193
int pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
 
194
 
 
195
int pthread_getconcurrency(void);
 
196
int pthread_setconcurrency(int);
 
197
 
 
198
int pthread_getcpuclockid(pthread_t, clockid_t *);
 
199
 
 
200
struct __ptcb {
 
201
        void (*__f)(void *);
 
202
        void *__x;
 
203
        struct __ptcb *__next;
 
204
};
 
205
 
 
206
void _pthread_cleanup_push(struct __ptcb *, void (*)(void *), void *);
 
207
void _pthread_cleanup_pop(struct __ptcb *, int);
 
208
 
 
209
#define pthread_cleanup_push(f, x) do { struct __ptcb __cb; _pthread_cleanup_push(&__cb, f, x);
 
210
#define pthread_cleanup_pop(r) _pthread_cleanup_pop(&__cb, (r)); } while(0)
 
211
 
 
212
#ifdef _GNU_SOURCE
 
213
struct cpu_set_t;
 
214
int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *);
 
215
int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *);
 
216
int pthread_getattr_np(pthread_t, pthread_attr_t *);
 
217
#endif
356
218
 
357
219
#ifdef __cplusplus
358
220
}
359
221
#endif
360
 
 
361
222
#endif
362
 
/* end of include file */