61 #ifndef __INCLUDE_PTHREAD_H 62 #define __INCLUDE_PTHREAD_H 68 #include <tinyara/config.h> 69 #include <tinyara/compiler.h> 71 #include <sys/types.h> 87 #ifndef _POSIX_THREADS 88 #define _POSIX_THREADS 91 #ifndef _POSIX_THREAD_ATTR_STACKSIZE 92 #define _POSIX_THREAD_ATTR_STACKSIZE 97 #define PTHREAD_PROCESS_PRIVATE 0 98 #define PTHREAD_PROCESS_SHARED 1 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 132 #define PTHREAD_STACK_MIN CONFIG_PTHREAD_STACK_MIN 133 #define PTHREAD_STACK_DEFAULT CONFIG_PTHREAD_STACK_DEFAULT 137 #define PTHREAD_INHERIT_SCHED 0 138 #define PTHREAD_EXPLICIT_SCHED 1 140 #define PTHREAD_PRIO_NONE 0 141 #define PTHREAD_PRIO_INHERIT 1 142 #define PTHREAD_PRIO_PROTECT 2 144 #define PTHREAD_DEFAULT_PRIORITY 100 148 #define PTHREAD_CANCEL_ENABLE (0) 149 #define PTHREAD_CANCEL_DISABLE (1) 153 #define PTHREAD_CANCELED ((FAR void*)ERROR) 157 #define PTHREAD_ONCE_INIT (false) 161 #define PTHREAD_BARRIER_SERIAL_THREAD 0x1000 177 #define pthread_setname_np(thread, name) \ 178 prctl((int)PR_SET_NAME, (char*)name, (int)thread) 188 #define pthread_getname_np(thread, name) \ 189 prctl((int)PR_GET_NAME, (char*)name, (int)thread) 242 #define PTHREAD_COND_INITIALIZER { {0, 0xffff} } 250 #ifdef CONFIG_MUTEX_TYPES 263 #ifdef CONFIG_MUTEX_TYPES 270 #ifdef CONFIG_MUTEX_TYPES 271 #define PTHREAD_MUTEX_INITIALIZER {0, SEM_INITIALIZER(1), PTHREAD_MUTEX_DEFAULT, 0} 273 #define PTHREAD_MUTEX_INITIALIZER {0, SEM_INITIALIZER(1)} 348 void pthread_exit(pthread_addr_t value) noreturn_function;
368 void pthread_testcancel(
void);
382 int pthread_join(pthread_t thread, FAR pthread_addr_t *value);
400 #define pthread_self() ((pthread_t)getpid()) 409 #define pthread_equal(t1, t2) (t1 == t2) 459 int pthread_key_delete(pthread_key_t key);
582 int pthread_once(FAR pthread_once_t *once_control, CODE
void (*init_routine)(
void));
685 #ifdef CONFIG_MUTEX_TYPES 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.
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.
Structure of pthread mutex configuration.
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
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.
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/)
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
POSIX operating system APIs.
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.
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/)
Structure of pthread mutex attr configuration.
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/)
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/)
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.
Structure of generic semaphore.
pthread_addr_t(* pthread_startroutine_t)(pthread_addr_t)
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/)
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/)
structure represents an elapsed time
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/)
int pthread_mutex_destroy(FAR pthread_mutex_t *mutex)
POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/)
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/)
Structure of pthread region configuration.
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/)