Xenomai API  2.6.5
pthread.h
1 /*
2  * Copyright (C) 2005 Philippe Gerum <[email protected]>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 
19 #ifndef _XENO_POSIX_PTHREAD_H
20 #define _XENO_POSIX_PTHREAD_H
21 
22 #if defined(__KERNEL__) || defined(__XENO_SIM__)
23 
24 #include <nucleus/xenomai.h>
25 
26 #ifdef __KERNEL__
27 #include <linux/types.h>
28 #include <sched.h>
29 #endif /* __KERNEL__ */
30 
31 #ifdef __XENO_SIM__
32 #include <posix_overrides.h>
33 #define PTHREAD_STACK_MIN 8192
34 #else /* __XENO_SIM__ */
35 #define PTHREAD_STACK_MIN 1024
36 #endif /* __XENO_SIM__ */
37 
38 #define PTHREAD_CREATE_JOINABLE 0
39 #define PTHREAD_CREATE_DETACHED 1
40 
41 #define PTHREAD_INHERIT_SCHED 0
42 #define PTHREAD_EXPLICIT_SCHED 1
43 
44 #define PTHREAD_SCOPE_SYSTEM 0
45 #define PTHREAD_SCOPE_PROCESS 1
46 
47 #define PTHREAD_MUTEX_NORMAL 0
48 #define PTHREAD_MUTEX_RECURSIVE 1
49 #define PTHREAD_MUTEX_ERRORCHECK 2
50 #define PTHREAD_MUTEX_DEFAULT 0
51 
52 #define PTHREAD_PRIO_NONE 0
53 #define PTHREAD_PRIO_INHERIT 1
54 #define PTHREAD_PRIO_PROTECT 2
55 
56 #define PTHREAD_PROCESS_PRIVATE 0
57 #define PTHREAD_PROCESS_SHARED 1
58 
59 #define PTHREAD_CANCEL_ENABLE 0
60 #define PTHREAD_CANCEL_DISABLE 1
61 
62 #define PTHREAD_CANCEL_DEFERRED 2
63 #define PTHREAD_CANCEL_ASYNCHRONOUS 3
64 
65 #define PTHREAD_CANCELED ((void *)-2)
66 
67 #define PTHREAD_DESTRUCTOR_ITERATIONS 4
68 #define PTHREAD_KEYS_MAX 128
69 
70 #define PTHREAD_ONCE_INIT { 0x86860808, 0 }
71 
72 struct timespec;
73 
74 struct pse51_thread;
75 
76 typedef struct pse51_thread *pthread_t;
77 
78 typedef struct pse51_threadattr {
79 
80  unsigned magic;
81  int detachstate;
82  size_t stacksize;
83  int inheritsched;
84  int policy;
85 
86  /* Non portable */
87  struct sched_param_ex schedparam_ex;
88  char *name;
89  int fp;
90  xnarch_cpumask_t affinity;
91 
92 } pthread_attr_t;
93 
94 /* pthread_mutexattr_t and pthread_condattr_t fit on 32 bits, for compatibility
95  with libc. */
96 struct pse51_key;
97 typedef struct pse51_key *pthread_key_t;
98 
99 typedef struct pse51_once {
100  unsigned magic;
101  int init_step;
102 } pthread_once_t;
103 
104 #ifdef __KERNEL__
105 /* The following definitions are copied from linuxthread pthreadtypes.h. */
106 struct _pthread_fastlock
107 {
108  long int __status;
109  int __spinlock;
110 };
111 
112 typedef struct
113 {
114  struct _pthread_fastlock __c_lock;
115  long __c_waiting;
116  char __padding[48 - sizeof (struct _pthread_fastlock)
117  - sizeof (long) - sizeof (long long)];
118  long long __align;
119 } pthread_cond_t;
120 
121 typedef struct
122 {
123  int __m_reserved;
124  int __m_count;
125  long __m_owner;
126  int __m_kind;
127  struct _pthread_fastlock __m_lock;
128 } pthread_mutex_t;
129 
130 #endif /* __KERNEL__ */
131 
132 #else /* !(__KERNEL__ || __XENO_SIM__) */
133 
134 #pragma GCC system_header
135 
136 #include <sched.h>
137 #include_next <pthread.h>
138 #include <nucleus/thread.h>
139 #include <nucleus/intr.h>
140 
141 struct timespec;
142 
143 #endif /* __KERNEL__ || __XENO_SIM__ */
144 
145 #ifndef PTHREAD_PRIO_NONE
146 #define PTHREAD_PRIO_NONE 0
147 #endif /* !PTHREAD_PRIO_NONE */
148 #ifndef PTHREAD_PRIO_INHERIT
149 #define PTHREAD_PRIO_INHERIT 1
150 #endif /* !PTHREAD_PRIO_INHERIT */
151 #ifndef PTHREAD_PRIO_PROTECT
152 #define PTHREAD_PRIO_PROTECT 2
153 #endif /* !PTHREAD_PRIO_PROTECT */
154 
155 #define PTHREAD_WARNSW XNTRAPSW
156 #define PTHREAD_LOCK_SCHED XNLOCK
157 #define PTHREAD_RPIOFF XNRPIOFF
158 #define PTHREAD_PRIMARY XNTHREAD_STATE_SPARE1
159 
160 #define PTHREAD_INOAUTOENA XN_ISR_NOENABLE
161 #define PTHREAD_IPROPAGATE XN_ISR_PROPAGATE
162 
163 #define PTHREAD_IENABLE 0
164 #define PTHREAD_IDISABLE 1
165 
166 struct pse51_mutexattr {
167  unsigned magic: 24;
168  unsigned type: 2;
169  unsigned protocol: 2;
170  unsigned pshared: 1;
171 };
172 
173 struct pse51_condattr {
174  unsigned magic: 24;
175  unsigned clock: 2;
176  unsigned pshared: 1;
177 };
178 
179 struct pse51_cond;
180 
181 union __xeno_cond {
182  pthread_cond_t native_cond;
183  struct __shadow_cond {
184  unsigned magic;
185  struct pse51_cond *cond;
186  } shadow_cond;
187 };
188 
189 struct pse51_interrupt;
190 
191 typedef struct pse51_interrupt *pthread_intr_t;
192 
193 #if defined(__KERNEL__) || defined(__XENO_SIM__)
194 typedef struct pse51_mutexattr pthread_mutexattr_t;
195 
196 typedef struct pse51_condattr pthread_condattr_t;
197 
198 #ifdef __cplusplus
199 extern "C" {
200 #endif
201 
202 int pthread_attr_init(pthread_attr_t *attr);
203 
204 int pthread_attr_destroy(pthread_attr_t *attr);
205 
206 int pthread_attr_getdetachstate(const pthread_attr_t *attr,
207  int *detachstate);
208 
209 int pthread_attr_setdetachstate(pthread_attr_t *attr,
210  int detachstate);
211 
212 int pthread_attr_getstackaddr(const pthread_attr_t *attr,
213  void **stackaddr);
214 
215 int pthread_attr_setstackaddr(pthread_attr_t *attr,
216  void *stackaddr);
217 
218 int pthread_attr_getstacksize(const pthread_attr_t *attr,
219  size_t *stacksize);
220 
221 int pthread_attr_setstacksize(pthread_attr_t *attr,
222  size_t stacksize);
223 
224 int pthread_attr_getinheritsched(const pthread_attr_t *attr,
225  int *inheritsched);
226 
227 int pthread_attr_setinheritsched(pthread_attr_t *attr,
228  int inheritsched);
229 
230 int pthread_attr_getschedpolicy(const pthread_attr_t *attr,
231  int *policy);
232 
233 int pthread_attr_setschedpolicy(pthread_attr_t *attr,
234  int policy);
235 
236 int pthread_attr_getschedparam(const pthread_attr_t *attr,
237  struct sched_param *par);
238 
239 int pthread_attr_getschedparam_ex(const pthread_attr_t *attr,
240  struct sched_param_ex *par);
241 
242 int pthread_attr_setschedparam(pthread_attr_t *attr,
243  const struct sched_param *par);
244 
245 int pthread_attr_setschedparam_ex(pthread_attr_t *attr,
246  const struct sched_param_ex *par);
247 
248 int pthread_attr_getscope(const pthread_attr_t *attr,
249  int *scope);
250 
251 int pthread_attr_setscope(pthread_attr_t *attr,
252  int scope);
253 
254 int pthread_attr_getname_np(const pthread_attr_t *attr,
255  const char **name);
256 
257 int pthread_attr_setname_np(pthread_attr_t *attr,
258  const char *name);
259 
260 int pthread_attr_getfp_np(const pthread_attr_t *attr,
261  int *use_fp);
262 
263 int pthread_attr_setfp_np(pthread_attr_t *attr,
264  int use_fp);
265 
266 int pthread_attr_getaffinity_np (const pthread_attr_t *attr,
267  xnarch_cpumask_t *mask);
268 
269 int pthread_attr_setaffinity_np (pthread_attr_t *attr,
270  xnarch_cpumask_t mask);
271 
272 int pthread_create(pthread_t *tid,
273  const pthread_attr_t *attr,
274  void *(*start) (void *),
275  void *arg ) __deprecated_in_kernel__;
276 
277 int pthread_detach(pthread_t thread);
278 
279 int pthread_equal(pthread_t t1,
280  pthread_t t2);
281 
282 void pthread_exit(void *value_ptr);
283 
284 int pthread_join(pthread_t thread,
285  void **value_ptr);
286 
287 pthread_t pthread_self(void);
288 
289 int pthread_getschedparam(pthread_t tid,
290  int *pol,
291  struct sched_param *par);
292 
293 int pthread_getschedparam_ex(pthread_t tid,
294  int *pol,
295  struct sched_param_ex *par);
296 
297 int pthread_setschedparam(pthread_t tid,
298  int pol,
299  const struct sched_param *par);
300 
301 int pthread_setschedparam_ex(pthread_t tid,
302  int pol,
303  const struct sched_param_ex *par);
304 
305 int pthread_mutexattr_init(pthread_mutexattr_t *attr);
306 
307 int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
308 
309 int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr,
310  int *type);
311 
312 int pthread_mutexattr_settype(pthread_mutexattr_t *attr,
313  int type);
314 
315 int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
316  int *proto);
317 
318 int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
319  int proto);
320 
321 int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr, int *pshared);
322 
323 int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared);
324 
325 int pthread_mutex_init(pthread_mutex_t *mutex,
326  const pthread_mutexattr_t *attr);
327 
328 int pthread_mutex_destroy(pthread_mutex_t *mutex);
329 
330 int pthread_mutex_trylock(pthread_mutex_t *mutex);
331 
332 int pthread_mutex_lock(pthread_mutex_t *mutex);
333 
334 int pthread_mutex_timedlock(pthread_mutex_t *mutex,
335  const struct timespec *to);
336 
337 int pthread_mutex_unlock(pthread_mutex_t *mutex);
338 
339 int pthread_condattr_init(pthread_condattr_t *attr);
340 
341 int pthread_condattr_destroy(pthread_condattr_t *attr);
342 
343 int pthread_condattr_getclock(const pthread_condattr_t *attr,
344  clockid_t *clk_id);
345 
346 int pthread_condattr_setclock(pthread_condattr_t *attr,
347  clockid_t clk_id);
348 
349 int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared);
350 
351 int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared);
352 
353 int pthread_cond_init(pthread_cond_t *cond,
354  const pthread_condattr_t *attr);
355 
356 int pthread_cond_destroy(pthread_cond_t *cond);
357 
358 int pthread_cond_wait(pthread_cond_t *cond,
359  pthread_mutex_t *mutex);
360 
361 int pthread_cond_timedwait(pthread_cond_t *cond,
362  pthread_mutex_t *mutex,
363  const struct timespec *abstime);
364 
365 int pthread_cond_signal(pthread_cond_t *cond);
366 
367 int pthread_cond_broadcast(pthread_cond_t *cond);
368 
369 int pthread_cancel(pthread_t thread);
370 
371 void pthread_cleanup_push(void (*routine)(void *),
372  void *arg);
373 
374 void pthread_cleanup_pop(int execute);
375 
376 int pthread_setcancelstate(int state,
377  int *oldstate);
378 
379 int pthread_setcanceltype(int type,
380  int *oldtype);
381 
382 void pthread_testcancel(void);
383 
384 int pthread_key_create(pthread_key_t *key,
385  void (*destructor)(void *));
386 
387 int pthread_key_delete(pthread_key_t key);
388 
389 void *pthread_getspecific(pthread_key_t key);
390 
391 int pthread_setspecific(pthread_key_t key,
392  const void *value);
393 
394 int pthread_once(pthread_once_t *once_control,
395  void (*init_routine)(void));
396 
397 int pthread_make_periodic_np(pthread_t thread,
398  struct timespec *starttp,
399  struct timespec *periodtp);
400 
401 int pthread_wait_np(unsigned long *overruns_r);
402 
403 int pthread_set_mode_np(int clrmask,
404  int setmask);
405 
406 int pthread_set_name_np(pthread_t thread,
407  const char *name);
408 
409 int pthread_intr_attach_np(pthread_intr_t *intr,
410  unsigned irq,
411  xnisr_t isr,
412  xniack_t iack);
413 
414 int pthread_intr_detach_np(pthread_intr_t intr);
415 
416 int pthread_intr_control_np(pthread_intr_t intr,
417  int cmd);
418 
419 #ifdef __cplusplus
420 }
421 #endif
422 
423 #else /* !(__KERNEL__ || __XENO_SIM__) */
424 
425 struct sched_param_ex;
426 
427 #ifdef __cplusplus
428 extern "C" {
429 #endif
430 
431 #ifndef CONFIG_XENO_HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
432 int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
433  int *proto);
434 
435 int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
436  int proto);
437 #endif
438 
439 #ifndef CONFIG_XENO_HAVE_PTHREAD_CONDATTR_SETCLOCK
440 int pthread_condattr_getclock(const pthread_condattr_t *attr,
441  clockid_t *clk_id);
442 
443 int pthread_condattr_setclock(pthread_condattr_t *attr,
444  clockid_t clk_id);
445 #endif
446 
447 int pthread_make_periodic_np(pthread_t thread,
448  struct timespec *starttp,
449  struct timespec *periodtp);
450 
451 int pthread_wait_np(unsigned long *overruns_r);
452 
453 int pthread_set_mode_np(int clrmask,
454  int setmask);
455 
456 int pthread_set_name_np(pthread_t thread,
457  const char *name);
458 
459 int pthread_intr_attach_np(pthread_intr_t *intr,
460  unsigned irq,
461  int mode);
462 
463 int pthread_intr_detach_np(pthread_intr_t intr);
464 
465 int pthread_intr_wait_np(pthread_intr_t intr,
466  const struct timespec *to);
467 
468 int pthread_intr_control_np(pthread_intr_t intr,
469  int cmd);
470 
471 int pthread_getschedparam_ex(pthread_t tid,
472  int *pol,
473  struct sched_param_ex *par);
474 
475 int pthread_setschedparam_ex(pthread_t tid,
476  int pol,
477  const struct sched_param_ex *par);
478 
479 int __real_pthread_create(pthread_t *tid,
480  const pthread_attr_t *attr,
481  void *(*start) (void *),
482  void *arg);
483 
484 int __real_pthread_detach(pthread_t thread);
485 
486 int __real_pthread_getschedparam(pthread_t thread,
487  int *policy,
488  struct sched_param *param);
489 
490 int __real_pthread_setschedparam(pthread_t thread,
491  int policy,
492  const struct sched_param *param);
493 int __real_pthread_yield(void);
494 
495 int __real_pthread_mutexattr_init(pthread_mutexattr_t *attr);
496 
497 int __real_pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
498 
499 int __real_pthread_mutexattr_gettype(const pthread_mutexattr_t *attr,
500  int *type);
501 
502 int __real_pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
503 
504 #ifdef CONFIG_XENO_HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
505 int __real_pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
506  int *proto);
507 
508 int __real_pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
509  int proto);
510 #endif
511 
512 int __real_pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr,
513  int *pshared);
514 
515 int __real_pthread_mutexattr_setpshared(pthread_mutexattr_t *attr,
516  int pshared);
517 
518 int __real_pthread_mutex_init(pthread_mutex_t *mutex,
519  const pthread_mutexattr_t *attr);
520 
521 int __real_pthread_mutex_destroy(pthread_mutex_t *mutex);
522 
523 int __real_pthread_mutex_lock(pthread_mutex_t *mutex);
524 
525 int __real_pthread_mutex_timedlock(pthread_mutex_t *mutex,
526  const struct timespec *to);
527 
528 int __real_pthread_mutex_trylock(pthread_mutex_t *mutex);
529 
530 int __real_pthread_mutex_unlock(pthread_mutex_t *mutex);
531 
532 int __real_pthread_condattr_init(pthread_condattr_t *attr);
533 
534 int __real_pthread_condattr_destroy(pthread_condattr_t *attr);
535 
536 int __real_pthread_condattr_getclock(const pthread_condattr_t *attr,
537  clockid_t *clk_id);
538 
539 int __real_pthread_condattr_setclock(pthread_condattr_t *attr,
540  clockid_t clk_id);
541 
542 int __real_pthread_condattr_getpshared(const pthread_condattr_t *attr,
543  int *pshared);
544 
545 int __real_pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared);
546 
547 int __real_pthread_cond_init (pthread_cond_t *cond,
548  const pthread_condattr_t *attr);
549 
550 int __real_pthread_cond_destroy(pthread_cond_t *cond);
551 
552 int __real_pthread_cond_wait(pthread_cond_t *cond,
553  pthread_mutex_t *mutex);
554 
555 int __real_pthread_cond_timedwait(pthread_cond_t *cond,
556  pthread_mutex_t *mutex,
557  const struct timespec *abstime);
558 
559 int __real_pthread_cond_signal(pthread_cond_t *cond);
560 
561 int __real_pthread_cond_broadcast(pthread_cond_t *cond);
562 
563 int __real_pthread_kill(pthread_t tid, int sig);
564 
565 #ifdef __cplusplus
566 }
567 #endif
568 
569 #endif /* __KERNEL__ || __XENO_SIM__ */
570 
571 #endif /* _XENO_POSIX_PTHREAD_H */
int pthread_mutex_unlock(pthread_mutex_t *mutex)
Unlock a mutex.
Definition: mutex.c:592
int pthread_set_name_np(pthread_t thread, const char *name)
Set a thread name.
Definition: thread.c:716
int pthread_setschedparam(pthread_t tid, int pol, const struct sched_param *par)
Set the scheduling policy and parameters of the specified thread.
Definition: sched.c:356
int pthread_wait_np(unsigned long *overruns_r)
Wait for current thread next period.
Definition: thread.c:621
int pthread_detach(pthread_t thread)
Detach a running thread.
Definition: thread.c:302
int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clk_id)
Set the clock selection attribute of a condition variable attributes object.
Definition: cond_attr.c:167
int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched)
Set inheritsched attribute.
Definition: thread_attr.c:373
int pthread_key_create(pthread_key_t *key, void(*destructor)(void *))
Create a thread-specific data key.
Definition: tsd.c:96
int pthread_attr_getname_np(const pthread_attr_t *attr, const char **name)
Get name attribute.
Definition: thread_attr.c:817
int pthread_join(pthread_t thread, void **value_ptr)
Wait for termination of a specified thread.
Definition: thread.c:431
int pthread_attr_getaffinity_np(const pthread_attr_t *attr, xnarch_cpumask_t *mask)
Get the processor affinity attribute.
Definition: thread_attr.c:1004
int pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clk_id)
Get the clock selection attribute from a condition variable attributes object.
Definition: cond_attr.c:125
int pthread_intr_wait_np(pthread_intr_t intr, const struct timespec *to)
Wait for the next interruption.
Definition: interrupt.c:52
int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate)
Get detachstate attribute.
Definition: thread_attr.c:151
int pthread_getschedparam(pthread_t tid, int *pol, struct sched_param *par)
Get the scheduling policy and parameters of the specified thread.
Definition: sched.c:198
int pthread_attr_getschedparam_ex(const pthread_attr_t *attr, struct sched_param_ex *par)
Get schedparam_ex extended attribute.
Definition: thread_attr.c:579
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type)
Get the mutex type attribute from a mutex attributes object.
Definition: mutex_attr.c:126
int pthread_cond_broadcast(pthread_cond_t *cond)
Broadcast a condition variable.
Definition: cond.c:578
int pthread_cond_destroy(pthread_cond_t *cond)
Destroy a condition variable.
Definition: cond.c:182
int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *par)
Set schedparam attribute.
Definition: thread_attr.c:624
int pthread_mutexattr_init(pthread_mutexattr_t *attr)
Initialize a mutex attributes object.
Definition: mutex_attr.c:56
int pthread_mutex_lock(pthread_mutex_t *mutex)
Lock a mutex.
Definition: mutex.c:488
int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
Get schedpolicy attribute.
Definition: thread_attr.c:425
int pthread_equal(pthread_t t1, pthread_t t2)
Compare thread identifiers.
Definition: thread.c:349
int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared)
Set the process-shared attribute of a mutex attributes object.
Definition: mutex_attr.c:391
int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared)
Set the process-shared attribute of a condition variable attributes object.
Definition: cond_attr.c:268
int pthread_key_delete(pthread_key_t key)
Delete a thread-specific data key.
Definition: tsd.c:257
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
Initialize a condition variable.
Definition: cond.c:103
int pthread_attr_destroy(pthread_attr_t *attr)
Destroy a thread attributes object.
Definition: thread_attr.c:100
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
Wait on a condition variable.
Definition: cond.c:409
int pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
Destroy a mutex attributes object.
Definition: mutex_attr.c:84
int pthread_attr_setschedparam_ex(pthread_attr_t *attr, const struct sched_param_ex *par)
Set extended schedparam_ex attribute.
Definition: thread_attr.c:675
int pthread_mutex_destroy(pthread_mutex_t *mutex)
Destroy a mutex.
Definition: mutex.c:246
int pthread_mutex_trylock(pthread_mutex_t *mutex)
Attempt to lock a mutex.
Definition: mutex.c:383
int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inheritsched)
Get inheritsched attribute.
Definition: thread_attr.c:330
int pthread_attr_getscope(const pthread_attr_t *attr, int *scope)
Get contention scope attribute.
Definition: thread_attr.c:726
int pthread_attr_init(pthread_attr_t *attr)
Initialize a thread attributes object.
Definition: thread_attr.c:81
int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
Set schedpolicy attribute.
Definition: thread_attr.c:467
int pthread_attr_setname_np(pthread_attr_t *attr, const char *name)
Set name attribute.
Definition: thread_attr.c:862
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime)
Wait a bounded time on a condition variable.
Definition: cond.c:476
int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
Set detachstate attribute.
Definition: thread_attr.c:197
int pthread_condattr_destroy(pthread_condattr_t *attr)
Destroy a condition variable attributes object.
Definition: cond_attr.c:83
int pthread_getschedparam_ex(pthread_t tid, int *pol, struct sched_param_ex *par)
Get the extended scheduling policy and parameters of the specified thread.
Definition: sched.c:249
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize)
Set stacksize attribute.
Definition: thread_attr.c:283
int pthread_attr_setaffinity_np(pthread_attr_t *attr, xnarch_cpumask_t mask)
Set the processor affinity attribute.
Definition: thread_attr.c:1047
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr, int *proto)
Get the protocol attribute from a mutex attributes object.
Definition: mutex_attr.c:234
int pthread_intr_control_np(pthread_intr_t intr, int cmd)
Control the state of an interrupt channel.
Definition: intr.c:226
int pthread_attr_setscope(pthread_attr_t *attr, int scope)
Set contention scope attribute.
Definition: thread_attr.c:768
int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *par)
Get schedparam attribute.
Definition: thread_attr.c:535
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr, int *pshared)
Get the process-shared attribute of a mutex attributes object.
Definition: mutex_attr.c:344
int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *to)
Attempt, during a bounded time, to lock a mutex.
Definition: mutex.c:541
int pthread_setcanceltype(int type, int *oldtype)
Set cancelability type of the current thread.
Definition: cancel.c:279
void * pthread_getspecific(pthread_key_t key)
Get the thread-specific value bound to the specified key.
Definition: tsd.c:215
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
Set the mutex type attribute of a mutex attributes object.
Definition: mutex_attr.c:176
void pthread_testcancel(void)
Test if a cancellation request is pending.
Definition: cancel.c:409
int pthread_cancel(pthread_t thread)
Cancel a thread.
Definition: cancel.c:89
void pthread_cleanup_pop(int execute)
Unregister the last registered cleanup handler.
Definition: cancel.c:211
void pthread_cleanup_push(cleanup_routine_t *routine, void *arg)
Register a cleanup handler to be executed at the time of cancellation.
Definition: cancel.c:153
int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize)
Get stacksize attribute.
Definition: thread_attr.c:241
int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared)
Get the process-shared attribute from a condition variable attributes object.
Definition: cond_attr.c:221
int pthread_create(pthread_t *tid, const pthread_attr_t *attr, void *(*start)(void *), void *arg) __deprecated_in_kernel__
Create a thread.
Definition: thread.c:165
int pthread_condattr_init(pthread_condattr_t *attr)
Initialize a condition variable attributes object.
Definition: cond_attr.c:55
void pthread_exit(void *value_ptr)
Terminate the current thread.
Definition: thread.c:372
int pthread_intr_attach_np(pthread_intr_t *intr, unsigned irq, xnisr_t isr, xniack_t iack)
Create and attach an interrupt object.
Definition: intr.c:102
int pthread_cond_signal(pthread_cond_t *cond)
Signal a condition variable.
Definition: cond.c:527
pthread_t pthread_self(void)
Get the identifier of the calling thread.
Definition: thread.c:541
int pthread_intr_detach_np(pthread_intr_t intr)
Destroy an interrupt object.
Definition: intr.c:202
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int proto)
Set the protocol attribute of a mutex attributes object.
Definition: mutex_attr.c:282
int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
Initialize a mutex.
Definition: mutex.c:151
int pthread_setcancelstate(int state, int *oldstate)
Set cancelability state of the current thread.
Definition: cancel.c:352
int pthread_set_mode_np(int clrmask, int setmask)
Set the mode of the current thread.
Definition: thread.c:668
int pthread_attr_setfp_np(pthread_attr_t *attr, int use_fp)
Set the floating point attribute.
Definition: thread_attr.c:960
int pthread_make_periodic_np(pthread_t thread, struct timespec *starttp, struct timespec *periodtp)
Make a thread periodic.
Definition: thread.c:569
int pthread_attr_getfp_np(const pthread_attr_t *attr, int *use_fp)
Get the floating point attribute.
Definition: thread_attr.c:919
int pthread_setschedparam_ex(pthread_t tid, int pol, const struct sched_param_ex *par)
Set the extended scheduling policy and parameters of the specified thread.
Definition: sched.c:434
init_step
Execute an initialization routine.
Definition: once.c:53
int pthread_setspecific(pthread_key_t key, const void *value)
Associate a thread-specific value with the specified key.
Definition: tsd.c:174