Tizen RT Libs&Environment  v1.0 D5
pthread.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright 2016 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an
13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14  * either express or implied. See the License for the specific
15  * language governing permissions and limitations under the License.
16  *
17  ****************************************************************************/
18 /********************************************************************************
19  * include/pthread.h
20  *
21  * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
22  * Author: Gregory Nutt <gnutt@nuttx.org>
23  *
24  * Redistribution and use in source and binary forms, with or without
25  * modification, are permitted provided that the following conditions
26  * are met:
27  *
28  * 1. Redistributions of source code must retain the above copyright
29  * notice, this list of conditions and the following disclaimer.
30  * 2. Redistributions in binary form must reproduce the above copyright
31  * notice, this list of conditions and the following disclaimer in
32  * the documentation and/or other materials provided with the
33  * distribution.
34  * 3. Neither the name NuttX nor the names of its contributors may be
35  * used to endorse or promote products derived from this software
36  * without specific prior written permission.
37  *
38  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
41  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
42  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
43  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
44  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
45  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
46  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
47  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
48  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49  * POSSIBILITY OF SUCH DAMAGE.
50  *
51  ********************************************************************************/
58 
61 #ifndef __INCLUDE_PTHREAD_H
62 #define __INCLUDE_PTHREAD_H
63 
64 /********************************************************************************
65  * Included Files
66  ********************************************************************************/
67 
68 #include <tinyara/config.h> /* Default settings */
69 #include <tinyara/compiler.h> /* Compiler settings, noreturn_function */
70 
71 #include <sys/types.h> /* Needed for general types */
72 #include <sys/prctl.h> /* Needed by pthread_[set|get]name_np */
73 
74 #include <stdint.h> /* C99 fixed width integer types */
75 #include <stdbool.h> /* C99 boolean types */
76 #include <unistd.h> /* For getpid */
77 #include <semaphore.h> /* Needed for sem_t */
78 #include <signal.h> /* Needed for sigset_t */
79 #include <time.h> /* Needed for struct timespec */
80 
81 /********************************************************************************
82  * Pre-processor Definitions
83  ********************************************************************************/
84 
85 /* Standard POSIX switches */
86 
87 #ifndef _POSIX_THREADS
88 #define _POSIX_THREADS
89 #endif
90 
91 #ifndef _POSIX_THREAD_ATTR_STACKSIZE
92 #define _POSIX_THREAD_ATTR_STACKSIZE
93 #endif
94 
95 /* Values for the process shared (pshared) attribute */
96 
97 #define PTHREAD_PROCESS_PRIVATE 0
98 #define PTHREAD_PROCESS_SHARED 1
99 
100 /* Values for the mutext type attribute:
101  *
102  * PTHREAD_MUTEX_NORMAL: This type of mutex does not detect deadlock. A thread
103  * attempting to relock this mutex without first unlocking it will deadlock.
104  * Attempting to unlock a mutex locked by a different thread results in undefined
105  * behavior. Attempting to unlock an unlocked mutex results in undefined behavior.
106  * PTHREAD_MUTEX_ERRORCHECK
107  * This type of mutex provides error checking. A thread attempting to relock this
108  * mutex without first unlocking it will return with an error. A thread attempting
109  * to unlock a mutex which another thread has locked will return with an error. A
110  * thread attempting to unlock an unlocked mutex will return with an error.
111  * PTHREAD_MUTEX_RECURSIVE
112  * A thread attempting to relock this mutex without first unlocking it will succeed
113  * in locking the mutex. The relocking deadlock which can occur with mutexes of type
114  * PTHREAD_MUTEX_NORMAL cannot occur with this type of mutex. Multiple locks of this
115  * mutex require the same number of unlocks to release the mutex before another thread
116  * can acquire the mutex. A thread attempting to unlock a mutex which another thread
117  * has locked will return with an error. A thread attempting to unlock an unlocked
118  * mutex will return with an error.
119  * PTHREAD_MUTEX_DEFAULT
120  * An implementation is allowed to map this mutex to one of the other mutex types.
121  */
122 
123 #ifdef CONFIG_MUTEX_TYPES
124 #define PTHREAD_MUTEX_NORMAL 0
125 #define PTHREAD_MUTEX_ERRORCHECK 1
126 #define PTHREAD_MUTEX_RECURSIVE 2
127 #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
128 #endif
129 
130 /* Valid ranges for the pthread stacksize attribute */
131 
132 #define PTHREAD_STACK_MIN CONFIG_PTHREAD_STACK_MIN
133 #define PTHREAD_STACK_DEFAULT CONFIG_PTHREAD_STACK_DEFAULT
134 
135 /* Values for the pthread inheritsched attribute */
136 
137 #define PTHREAD_INHERIT_SCHED 0
138 #define PTHREAD_EXPLICIT_SCHED 1
139 
140 #define PTHREAD_PRIO_NONE 0
141 #define PTHREAD_PRIO_INHERIT 1
142 #define PTHREAD_PRIO_PROTECT 2
143 
144 #define PTHREAD_DEFAULT_PRIORITY 100
145 
146 /* Cancellation states returned by pthread_cancelstate() */
147 
148 #define PTHREAD_CANCEL_ENABLE (0)
149 #define PTHREAD_CANCEL_DISABLE (1)
150 
151 /* Thread return value when a pthread is canceled */
152 
153 #define PTHREAD_CANCELED ((FAR void*)ERROR)
154 
155 /* Used to initialize a pthread_once_t */
156 
157 #define PTHREAD_ONCE_INIT (false)
158 
159 /* This is returned by pthread_wait. It must not match any errno in errno.h */
160 
161 #define PTHREAD_BARRIER_SERIAL_THREAD 0x1000
162 
163 /* Definitions to map some non-standard, BSD thread management interfaces to
164  * the non-standard Linux-like prctl() interface. Since these are simple
165  * mappings to prctl, they will return 0 sucess and -1 on failure with the
166  * err number in errno. This is an inconsistency with out pthread interfaces.
167  */
168 
177 #define pthread_setname_np(thread, name) \
178  prctl((int)PR_SET_NAME, (char*)name, (int)thread)
179 
188 #define pthread_getname_np(thread, name) \
189  prctl((int)PR_GET_NAME, (char*)name, (int)thread)
190 
191 /********************************************************************************
192  * Global Type Declarations
193  ********************************************************************************/
194 
195 #ifdef __cplusplus
196 extern "C" {
197 #endif
198 
199 /* pthread-specific types */
200 
201 typedef int pthread_key_t;
202 typedef FAR void *pthread_addr_t;
203 typedef pthread_addr_t any_t;
204 
207 
213  void *address; /* start address of the region */
214  uint32_t size; /* size of the region in bytes */
215  uint32_t attributes; /* attributes of the region */
216 };
222  size_t stacksize; /* Size of the stack allocated for the pthead */
223  int16_t priority; /* Priority of the pthread */
224  uint8_t policy; /* Pthread scheduler policy */
225  uint8_t inheritsched; /* Inherit parent prio/policy? */
226  struct pthread_region_s region[2]; /* space for user-space region if MPU supported */
227 };
229 
230 typedef pid_t pthread_t;
231 
232 typedef int pthread_condattr_t;
233 
240 };
242 #define PTHREAD_COND_INITIALIZER { {0, 0xffff} }
243 
249  uint8_t pshared; /* PTHREAD_PROCESS_PRIVATE or PTHREAD_PROCESS_SHARED */
250 #ifdef CONFIG_MUTEX_TYPES
251  uint8_t type; /* Type of the mutex. See PTHREAD_MUTEX_* definitions */
252 #endif
253 };
255 
261  int pid; /* ID of the holder of the mutex */
262  sem_t sem; /* Semaphore underlying the implementation of the mutex */
263 #ifdef CONFIG_MUTEX_TYPES
264  uint8_t type; /* Type of the mutex. See PTHREAD_MUTEX_* definitions */
265  int nlocks; /* The number of recursive locks held */
266 #endif
267 };
269 
270 #ifdef CONFIG_MUTEX_TYPES
271 #define PTHREAD_MUTEX_INITIALIZER {0, SEM_INITIALIZER(1), PTHREAD_MUTEX_DEFAULT, 0}
272 #else
273 #define PTHREAD_MUTEX_INITIALIZER {0, SEM_INITIALIZER(1)}
274 #endif
275 
281  int pshared;
282 };
284 
291  unsigned int count;
292 };
294 
295 typedef bool pthread_once_t;
296 
297 /* Forware references */
298 
299 struct sched_param; /* Defined in sched.h */
300 
301 /********************************************************************************
302  * Global Variables
303  ********************************************************************************/
304 
305 /********************************************************************************
306  * Global Function Prototypes
307  ********************************************************************************/
308 
309 /* Initializes a thread attributes object (attr) with default values for all of
310  * the individual attributes used by a given implementation.
311  */
312 
313 /* To create a thread object and runnable thread, a routine must be specified
314  * as the new thread's start routine. An argument may be passed to this
315  * routine, as an untyped address; an untyped address may also be returned as
316  * the routine's value. An attributes object may be used to specify details
317  * about the kind of thread being created.
318  */
319 
326 int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, pthread_startroutine_t startroutine, pthread_addr_t arg);
327 
328 /* A thread object may be "detached" to specify that the return value and
329  * completion status will not be requested.
330  */
337 int pthread_detach(pthread_t thread);
338 
339 /* A thread may terminate it's own execution or the execution of another
340  * thread.
341  */
348 void pthread_exit(pthread_addr_t value) noreturn_function;
355 int pthread_cancel(pthread_t thread);
362 int pthread_setcancelstate(int state, FAR int *oldstate);
363 
368 void pthread_testcancel(void);
372 /* A thread can await termination of another thread and retrieve the return
373  * value of the thread.
374  */
375 
382 int pthread_join(pthread_t thread, FAR pthread_addr_t *value);
383 
384 /* A thread may tell the scheduler that its processor can be made available. */
391 void pthread_yield(void);
392 
393 /* A thread may obtain a copy of its own thread handle. */
400 #define pthread_self() ((pthread_t)getpid())
401 
402 /* Compare two thread IDs. */
409 #define pthread_equal(t1, t2) (t1 == t2)
410 
411 /* Thread scheduling parameters */
418 int pthread_getschedparam(pthread_t thread, FAR int *policy, FAR struct sched_param *param);
425 int pthread_setschedparam(pthread_t thread, int policy, FAR const struct sched_param *param);
431 int pthread_setschedprio(pthread_t thread, int prio);
432 
433 /* Thread-specific Data Interfaces */
440 int pthread_key_create(FAR pthread_key_t *key, CODE void (*destructor)(FAR void *));
447 int pthread_setspecific(pthread_key_t key, FAR const void *value);
454 FAR void *pthread_getspecific(pthread_key_t key);
459 int pthread_key_delete(pthread_key_t key);
464 /* The following routines create, delete, lock and unlock mutexes. */
465 
472 int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t *attr);
479 int pthread_mutex_destroy(FAR pthread_mutex_t *mutex);
486 int pthread_mutex_lock(FAR pthread_mutex_t *mutex);
493 int pthread_mutex_trylock(FAR pthread_mutex_t *mutex);
500 int pthread_mutex_unlock(FAR pthread_mutex_t *mutex);
501 
502 /* A thread can create and delete condition variables. */
509 int pthread_cond_init(FAR pthread_cond_t *cond, FAR const pthread_condattr_t *attr);
516 int pthread_cond_destroy(FAR pthread_cond_t *cond);
517 
518 /* A thread can signal to and broadcast on a condition variable. */
532 int pthread_cond_signal(FAR pthread_cond_t *cond);
533 
534 /* A thread can wait for a condition variable to be signalled or broadcast. */
541 int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex);
542 
543 /* A thread can perform a timed wait on a condition variable. */
550 int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, FAR const struct timespec *abstime);
551 
552 /* Barriers */
566 int pthread_barrier_init(FAR pthread_barrier_t *barrier, FAR const pthread_barrierattr_t *attr, unsigned int count);
573 int pthread_barrier_wait(FAR pthread_barrier_t *barrier);
574 
575 /* Pthread initialization */
582 int pthread_once(FAR pthread_once_t *once_control, CODE void (*init_routine)(void));
583 
584 /* Pthread signal management APIs */
591 int pthread_kill(pthread_t thread, int sig);
598 int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset);
599 
608 int pthread_attr_init(FAR pthread_attr_t *attr);
609 
610 /* An attributes object can be deleted when it is no longer needed. */
611 
617 
618 /* Set or obtain the default scheduling algorithm */
619 
624 int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy);
629 int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy);
634 int pthread_attr_setschedparam(FAR pthread_attr_t *attr, FAR const struct sched_param *param);
639 int pthread_attr_getschedparam(FAR const pthread_attr_t *attr, FAR struct sched_param *param);
644 int pthread_attr_setinheritsched(FAR pthread_attr_t *attr, int inheritsched);
649 int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr, FAR int *inheritsched);
650 
651 /* Set or obtain the default stack size */
656 int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize);
657 
662 int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, long *stackaddr);
663 
664 /* Create, operate on, and destroy mutex attributes. */
679 int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr, FAR int *pshared);
684 int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr, int pshared);
685 #ifdef CONFIG_MUTEX_TYPES
686 
690 int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
696 #endif
697 
698 /* Operations on condition variables */
703 int pthread_condattr_init(FAR pthread_condattr_t *attr);
708 int pthread_condattr_destroy(FAR pthread_condattr_t *attr);
709 
710 /* Barrier attributes */
725 int pthread_barrierattr_getpshared(FAR const pthread_barrierattr_t *attr, FAR int *pshared);
730 int pthread_barrierattr_setpshared(FAR pthread_barrierattr_t *attr, int pshared); //end for PTHREAD_KERNEL
733 
734 #ifdef __cplusplus
735 }
736 #endif
737 #endif /* __INCLUDE_PTHREAD_H */
int pthread_cancel(pthread_t thread)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_once(FAR pthread_once_t *once_control, CODE void(*init_routine)(void))
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
Structure of pthread barrier attr configuration.
Definition: pthread.h:280
int pthread_setcancelstate(int state, FAR int *oldstate)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_kill(pthread_t thread, int sig)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_attr_destroy(pthread_attr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_mutex_unlock(FAR pthread_mutex_t *mutex)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_mutex_trylock(FAR pthread_mutex_t *mutex)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_attr_setinheritsched(FAR pthread_attr_t *attr, int inheritsched)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
Structure of pthread condition configuration.
Definition: pthread.h:238
Structure of pthread mutex configuration.
Definition: pthread.h:260
int pthread_join(pthread_t thread, FAR pthread_addr_t *value)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
void pthread_exit(pthread_addr_t value) noreturn_function
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_cond_destroy(FAR pthread_cond_t *cond)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
FAR void * pthread_addr_t
Definition: pthread.h:202
int pthread_condattr_t
Definition: pthread.h:232
int pthread_attr_getschedparam(FAR const pthread_attr_t *attr, FAR struct sched_param *param)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, long *stackaddr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
POSIX-like scheduling parameter structure.
Definition: sched.h:105
int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr, FAR int *inheritsched)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_cond_broadcast(FAR pthread_cond_t *cond)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_barrier_destroy(FAR pthread_barrier_t *barrier)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_getschedparam(pthread_t thread, FAR int *policy, FAR struct sched_param *param)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
void * address
Definition: pthread.h:213
int pthread_mutex_lock(FAR pthread_mutex_t *mutex)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_condattr_destroy(FAR pthread_condattr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
pthread_startroutine_t pthread_func_t
Definition: pthread.h:206
POSIX operating system APIs.
Signal APIs.
bool pthread_once_t
Definition: pthread.h:295
int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
void pthread_yield(void)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr, int pshared)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
Structure of pthread attr configuration.
Definition: pthread.h:221
int pthread_barrierattr_destroy(FAR pthread_barrierattr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
FAR void * pthread_getspecific(pthread_key_t key)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_attr_init(FAR pthread_attr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_barrierattr_getpshared(FAR const pthread_barrierattr_t *attr, FAR int *pshared)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_cond_signal(FAR pthread_cond_t *cond)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
pthread_addr_t any_t
Definition: pthread.h:203
Structure of pthread mutex attr configuration.
Definition: pthread.h:248
int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, FAR const struct timespec *abstime)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_condattr_init(FAR pthread_condattr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_barrier_init(FAR pthread_barrier_t *barrier, FAR const pthread_barrierattr_t *attr, unsigned int count)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_setschedprio(pthread_t thread, int prio)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_setspecific(pthread_key_t key, FAR const void *value)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
uint8_t inheritsched
Definition: pthread.h:225
uint8_t type
Definition: pthread.h:264
int pthread_cond_init(FAR pthread_cond_t *cond, FAR const pthread_condattr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_key_create(FAR pthread_key_t *key, CODE void(*destructor)(FAR void *))
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
Semaphore APIs.
int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr, FAR int *pshared)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
Structure of pthread barrier configuration.
Definition: pthread.h:289
Structure of generic semaphore.
Definition: semaphore.h:115
int pthread_key_t
Definition: pthread.h:201
pthread_addr_t(* pthread_startroutine_t)(pthread_addr_t)
Definition: pthread.h:205
int pthread_detach(pthread_t thread)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
unsigned int count
Definition: pthread.h:291
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_attr_setschedparam(FAR pthread_attr_t *attr, FAR const struct sched_param *param)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
uint8_t policy
Definition: pthread.h:224
structure represents an elapsed time
Definition: time.h:152
uint32_t attributes
Definition: pthread.h:215
int pthread_barrierattr_setpshared(FAR pthread_barrierattr_t *attr, int pshared)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_setschedparam(pthread_t thread, int policy, FAR const struct sched_param *param)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_barrierattr_init(FAR pthread_barrierattr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
uint32_t size
Definition: pthread.h:214
uint32_t sigset_t
Definition: signal.h:213
int pthread_mutex_destroy(FAR pthread_mutex_t *mutex)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
size_t stacksize
Definition: pthread.h:222
int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, pthread_startroutine_t startroutine, pthread_addr_t arg)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int16_t priority
Definition: pthread.h:223
Structure of pthread region configuration.
Definition: pthread.h:212
int pthread_barrier_wait(FAR pthread_barrier_t *barrier)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t *attr)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
pid_t pthread_t
Definition: pthread.h:230