Tizen RT Libs&Environment  v1.0 D5
pthread.h File Reference

Pthread APIs. More...

#include <tinyara/config.h>
#include <tinyara/compiler.h>
#include <sys/types.h>
#include <sys/prctl.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <semaphore.h>
#include <signal.h>
#include <time.h>
Include dependency graph for pthread.h:

Go to the source code of this file.

Data Structures

struct  pthread_region_s
 Structure of pthread region configuration. More...
 
struct  pthread_attr_s
 Structure of pthread attr configuration. More...
 
struct  pthread_cond_s
 Structure of pthread condition configuration. More...
 
struct  pthread_mutexattr_s
 Structure of pthread mutex attr configuration. More...
 
struct  pthread_mutex_s
 Structure of pthread mutex configuration. More...
 
struct  pthread_barrierattr_s
 Structure of pthread barrier attr configuration. More...
 
struct  pthread_barrier_s
 Structure of pthread barrier configuration. More...
 

Macros

#define _POSIX_THREADS
 
#define _POSIX_THREAD_ATTR_STACKSIZE
 
#define PTHREAD_PROCESS_PRIVATE   0
 
#define PTHREAD_PROCESS_SHARED   1
 
#define PTHREAD_MUTEX_NORMAL   0
 
#define PTHREAD_MUTEX_ERRORCHECK   1
 
#define PTHREAD_MUTEX_RECURSIVE   2
 
#define PTHREAD_MUTEX_DEFAULT   PTHREAD_MUTEX_NORMAL
 
#define PTHREAD_STACK_MIN   CONFIG_PTHREAD_STACK_MIN
 
#define PTHREAD_STACK_DEFAULT   CONFIG_PTHREAD_STACK_DEFAULT
 
#define PTHREAD_INHERIT_SCHED   0
 
#define PTHREAD_EXPLICIT_SCHED   1
 
#define PTHREAD_PRIO_NONE   0
 
#define PTHREAD_PRIO_INHERIT   1
 
#define PTHREAD_PRIO_PROTECT   2
 
#define PTHREAD_DEFAULT_PRIORITY   100
 
#define PTHREAD_CANCEL_ENABLE   (0)
 
#define PTHREAD_CANCEL_DISABLE   (1)
 
#define PTHREAD_CANCELED   ((FAR void*)ERROR)
 
#define PTHREAD_ONCE_INIT   (false)
 
#define PTHREAD_BARRIER_SERIAL_THREAD   0x1000
 
#define pthread_setname_np(thread, name)   prctl((int)PR_SET_NAME, (char*)name, (int)thread)
 sets the name of pthread More...
 
#define pthread_getname_np(thread, name)   prctl((int)PR_GET_NAME, (char*)name, (int)thread)
 gets the name of pthread More...
 
#define PTHREAD_COND_INITIALIZER   { {0, 0xffff} }
 
#define PTHREAD_MUTEX_INITIALIZER   {0, SEM_INITIALIZER(1), PTHREAD_MUTEX_DEFAULT, 0}
 
#define pthread_self()   ((pthread_t)getpid())
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
#define pthread_equal(t1, t2)   (t1 == t2)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 

Typedefs

typedef int pthread_key_t
 
typedef FAR void * pthread_addr_t
 
typedef pthread_addr_t any_t
 
typedef pthread_addr_t(* pthread_startroutine_t) (pthread_addr_t)
 
typedef pthread_startroutine_t pthread_func_t
 
typedef struct pthread_attr_s pthread_attr_t
 
typedef pid_t pthread_t
 
typedef int pthread_condattr_t
 
typedef struct pthread_cond_s pthread_cond_t
 
typedef struct pthread_mutexattr_s pthread_mutexattr_t
 
typedef struct pthread_mutex_s pthread_mutex_t
 
typedef struct pthread_barrierattr_s pthread_barrierattr_t
 
typedef struct pthread_barrier_s pthread_barrier_t
 
typedef bool pthread_once_t
 

Functions

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/) More...
 
int pthread_detach (pthread_t thread)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
void pthread_exit (pthread_addr_t value) noreturn_function
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_cancel (pthread_t thread)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_setcancelstate (int state, FAR int *oldstate)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_join (pthread_t thread, FAR pthread_addr_t *value)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
void pthread_yield (void)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_getschedparam (pthread_t thread, FAR int *policy, FAR struct sched_param *param)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_setschedparam (pthread_t thread, int policy, FAR const struct sched_param *param)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_setschedprio (pthread_t thread, int prio)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_key_create (FAR pthread_key_t *key, CODE void(*destructor)(FAR void *))
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_setspecific (pthread_key_t key, FAR const void *value)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
FAR void * pthread_getspecific (pthread_key_t key)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
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/) More...
 
int pthread_mutex_destroy (FAR pthread_mutex_t *mutex)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_mutex_lock (FAR pthread_mutex_t *mutex)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_mutex_trylock (FAR pthread_mutex_t *mutex)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_mutex_unlock (FAR pthread_mutex_t *mutex)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
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/) More...
 
int pthread_cond_destroy (FAR pthread_cond_t *cond)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_cond_broadcast (FAR pthread_cond_t *cond)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_cond_signal (FAR pthread_cond_t *cond)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_cond_wait (FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
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/) More...
 
int pthread_barrier_destroy (FAR pthread_barrier_t *barrier)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
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/) More...
 
int pthread_barrier_wait (FAR pthread_barrier_t *barrier)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_once (FAR pthread_once_t *once_control, CODE void(*init_routine)(void))
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_kill (pthread_t thread, int sig)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_sigmask (int how, FAR const sigset_t *set, FAR sigset_t *oset)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_attr_init (FAR pthread_attr_t *attr)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_attr_destroy (pthread_attr_t *attr)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_attr_setschedpolicy (FAR pthread_attr_t *attr, int policy)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_attr_getschedpolicy (FAR const pthread_attr_t *attr, int *policy)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
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/) More...
 
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/) More...
 
int pthread_attr_setinheritsched (FAR pthread_attr_t *attr, int inheritsched)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_attr_getinheritsched (FAR const pthread_attr_t *attr, FAR int *inheritsched)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_attr_setstacksize (FAR pthread_attr_t *attr, long stacksize)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_attr_getstacksize (FAR const pthread_attr_t *attr, long *stackaddr)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_mutexattr_init (FAR pthread_mutexattr_t *attr)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_mutexattr_destroy (FAR pthread_mutexattr_t *attr)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_mutexattr_getpshared (FAR const pthread_mutexattr_t *attr, FAR int *pshared)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_mutexattr_setpshared (FAR pthread_mutexattr_t *attr, int pshared)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_condattr_init (FAR pthread_condattr_t *attr)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_condattr_destroy (FAR pthread_condattr_t *attr)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_barrierattr_destroy (FAR pthread_barrierattr_t *attr)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_barrierattr_init (FAR pthread_barrierattr_t *attr)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_barrierattr_getpshared (FAR const pthread_barrierattr_t *attr, FAR int *pshared)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 
int pthread_barrierattr_setpshared (FAR pthread_barrierattr_t *attr, int pshared)
 POSIX APIs (refer to : http://pubs.opengroup.org/onlinepubs/9699919799/) More...
 

Detailed Description

Pthread APIs.

Definition in file pthread.h.

Macro Definition Documentation

#define _POSIX_THREAD_ATTR_STACKSIZE

Definition at line 92 of file pthread.h.

#define _POSIX_THREADS

Definition at line 88 of file pthread.h.

#define PTHREAD_BARRIER_SERIAL_THREAD   0x1000

Definition at line 161 of file pthread.h.

#define PTHREAD_CANCEL_DISABLE   (1)

Definition at line 149 of file pthread.h.

#define PTHREAD_CANCEL_ENABLE   (0)

Definition at line 148 of file pthread.h.

#define PTHREAD_CANCELED   ((FAR void*)ERROR)

Definition at line 153 of file pthread.h.

#define PTHREAD_COND_INITIALIZER   { {0, 0xffff} }

Definition at line 242 of file pthread.h.

#define PTHREAD_DEFAULT_PRIORITY   100

Definition at line 144 of file pthread.h.

#define PTHREAD_EXPLICIT_SCHED   1

Definition at line 138 of file pthread.h.

#define PTHREAD_INHERIT_SCHED   0

Definition at line 137 of file pthread.h.

#define PTHREAD_MUTEX_DEFAULT   PTHREAD_MUTEX_NORMAL

Definition at line 127 of file pthread.h.

#define PTHREAD_MUTEX_ERRORCHECK   1

Definition at line 125 of file pthread.h.

#define PTHREAD_MUTEX_INITIALIZER   {0, SEM_INITIALIZER(1), PTHREAD_MUTEX_DEFAULT, 0}

Definition at line 271 of file pthread.h.

#define PTHREAD_MUTEX_NORMAL   0

Definition at line 124 of file pthread.h.

#define PTHREAD_MUTEX_RECURSIVE   2

Definition at line 126 of file pthread.h.

#define PTHREAD_ONCE_INIT   (false)

Definition at line 157 of file pthread.h.

#define PTHREAD_PRIO_INHERIT   1

Definition at line 141 of file pthread.h.

#define PTHREAD_PRIO_NONE   0

Definition at line 140 of file pthread.h.

#define PTHREAD_PRIO_PROTECT   2

Definition at line 142 of file pthread.h.

#define PTHREAD_PROCESS_PRIVATE   0

Definition at line 97 of file pthread.h.

#define PTHREAD_PROCESS_SHARED   1

Definition at line 98 of file pthread.h.

#define PTHREAD_STACK_DEFAULT   CONFIG_PTHREAD_STACK_DEFAULT

Definition at line 133 of file pthread.h.

#define PTHREAD_STACK_MIN   CONFIG_PTHREAD_STACK_MIN

Definition at line 132 of file pthread.h.

Typedef Documentation

Definition at line 203 of file pthread.h.

typedef FAR void* pthread_addr_t

Definition at line 202 of file pthread.h.

Definition at line 228 of file pthread.h.

Definition at line 293 of file pthread.h.

Definition at line 283 of file pthread.h.

Definition at line 241 of file pthread.h.

typedef int pthread_condattr_t

Definition at line 232 of file pthread.h.

Definition at line 206 of file pthread.h.

typedef int pthread_key_t

Definition at line 201 of file pthread.h.

Definition at line 268 of file pthread.h.

Definition at line 254 of file pthread.h.

typedef bool pthread_once_t

Definition at line 295 of file pthread.h.

typedef pthread_addr_t(* pthread_startroutine_t) (pthread_addr_t)

Definition at line 205 of file pthread.h.

typedef pid_t pthread_t

Definition at line 230 of file pthread.h.