.TH "pthread.h" 3teegris "Sun Oct 28 2018" "Version 2.0" "Samsung Internal API reference" \" -*- nroff -*-
.ad l
.nh
.SH NAME
pthread.h \- POSIX compatible thread library\&.  

.SH SYNOPSIS
.br
.PP
.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fB__pthread_once_t\fP"
.br
.ti -1c
.RI "struct \fB__pthread_attr_t\fP"
.br
.ti -1c
.RI "struct \fB__pthread_mutex_t\fP"
.br
.ti -1c
.RI "struct \fB__pthread_cond_t\fP"
.br
.ti -1c
.RI "struct \fB__pthread_condattr_t\fP"
.br
.in -1c
.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBPTHREAD_STACK_MIN\fP   (PAGE_SIZE)"
.br
.ti -1c
.RI "#define \fBMUTEX_STATE_UNLOCKED\fP   0"
.br
.ti -1c
.RI "#define \fBMUTEX_STATE_LOCKED\fP   1"
.br
.ti -1c
.RI "#define \fBPTHREAD_MUTEX_INITIALIZER\fP   { { \fBMUTEX_STATE_UNLOCKED\fP }, \fBPTHREAD_MUTEX_DEFAULT\fP, 0, 0 }"
.br
.ti -1c
.RI "#define \fBPTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP\fP   { { \fBMUTEX_STATE_UNLOCKED\fP }, \fBPTHREAD_MUTEX_ERRORCHECK\fP, 0, 0 }"
.br
.ti -1c
.RI "#define \fBPTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP\fP   { { \fBMUTEX_STATE_UNLOCKED\fP }, \fBPTHREAD_MUTEX_RECURSIVE\fP, 0, 0 }"
.br
.ti -1c
.RI "#define \fBPTHREAD_ONCE_INIT\fP   { ATOMIC_INITIALIZER }"
.br
.ti -1c
.RI "#define \fBPTHREAD_COND_INITIALIZER\fP   { ATOMIC_INITIALIZER }"
.br
.RI "\fIObject for static initialization of \fBpthread_cond_t\fP variables\&. \fP"
.ti -1c
.RI "#define \fBpthread_sigmask\fP(how,  set,  oldset)   sigprocmask(how, set, oldset)"
.br
.RI "\fISet signal mask for specified thread\&. \fP"
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef struct pthread_impl \fBpthread_impl_t\fP"
.br
.ti -1c
.RI "typedef uintptr_t \fBpthread_t\fP"
.br
.ti -1c
.RI "typedef uint32_t \fBpthread_mutexattr_t\fP"
.br
.ti -1c
.RI "typedef struct \fB__pthread_mutex_t\fP \fBpthread_mutex_t\fP"
.br
.ti -1c
.RI "typedef unsigned \fBpthread_key_t\fP"
.br
.ti -1c
.RI "typedef struct \fB__pthread_attr_t\fP \fBpthread_attr_t\fP"
.br
.ti -1c
.RI "typedef struct \fB__pthread_once_t\fP \fBpthread_once_t\fP"
.br
.ti -1c
.RI "typedef struct \fB__pthread_cond_t\fP \fBpthread_cond_t\fP"
.br
.ti -1c
.RI "typedef struct \fB__pthread_cond_t\fP \fBpthread_condattr_t\fP"
.br
.in -1c
.SS "Enumerations"

.in +1c
.ti -1c
.RI "enum { \fBPTHREAD_MUTEX_NORMAL\fP = 0, \fBPTHREAD_MUTEX_RECURSIVE\fP, \fBPTHREAD_MUTEX_ERRORCHECK\fP, \fBPTHREAD_MUTEX_DEFAULT\fP = PTHREAD_MUTEX_NORMAL, \fBPTHREAD_MUTEX_DESTROYED\fP = -1, \fBPTHREAD_MUTEX_ERRORCHECK_NP\fP = PTHREAD_MUTEX_ERRORCHECK, \fBPTHREAD_MUTEX_RECURSIVE_NP\fP = PTHREAD_MUTEX_RECURSIVE }
.RI "\fItypes and states for mutex \fP""
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "int \fBpthread_attr_init\fP (\fBpthread_attr_t\fP *attr)"
.br
.RI "\fIThe \fBpthread_attr_init()\fP function initialize attribute struct\&. \fP"
.ti -1c
.RI "int \fBpthread_attr_destroy\fP (\fBpthread_attr_t\fP *attr)"
.br
.RI "\fIThe \fBpthread_attr_destroy()\fP function destroy attribute struct\&. \fP"
.ti -1c
.RI "int \fBpthread_attr_setstacksize\fP (\fBpthread_attr_t\fP *attr, size_t size)"
.br
.RI "\fIThe \fBpthread_attr_setstacksize()\fP function sets size of stack\&. \fP"
.ti -1c
.RI "int \fBpthread_create\fP (\fBpthread_t\fP *thread, const \fBpthread_attr_t\fP *attr, void *(*start_routine)(void *), void *arg)"
.br
.RI "\fIThe \fBpthread_create()\fP function starts a new thread in the calling process\&. The new thread starts execution by invoking \fCstart_routine()\fP \fCarg\fP is passed as the sole argument of \fCstart_routine()\fP\&. \fP"
.ti -1c
.RI "int \fBpthread_join\fP (\fBpthread_t\fP thread, void **retval)"
.br
.RI "\fIWait for the thread specified by \fCthread\fP to terminate\&. If that thread has already terminated, then returns immediately\&. The thread specified by \fCthread\fP must be joinable\&. \fP"
.ti -1c
.RI "int \fBpthread_once\fP (\fBpthread_once_t\fP *once_control, void(*init_routine)(void))"
.br
.RI "\fIIf any thread in a process with a \fConce_control\fP parameter makes a call to \fBpthread_once()\fP, the first call will summon the \fCinit_routine()\fP, but subsequent calls will not\&. The \fConce_control\fP parameter determines whether the associated initialization routine has been called\&. The \fCinit_routine()\fP is complete upon return of \fBpthread_once()\fP\&. \fP"
.ti -1c
.RI "void * \fBpthread_getspecific\fP (\fBpthread_key_t\fP key)"
.br
.RI "\fIReturn the value currently bound to the specified \fCkey\fP on behalf of the calling thread\&. \fP"
.ti -1c
.RI "int \fBpthread_setspecific\fP (\fBpthread_key_t\fP key, const void *value)"
.br
.RI "\fIAssociate a thread-specific \fCvalue\fP with a \fCkey\fP obtained via a previous call to \fBpthread_key_create()\fP\&. \fP"
.ti -1c
.RI "int \fBpthread_key_create\fP (\fBpthread_key_t\fP *key, void(*destructor)(void *))"
.br
.RI "\fICreate data key for data manipulation functions (\fBpthread_getspecific()\fP, \fBpthread_setspecific()\fP)\&. Multiple threads can call data manipulation functions with the same key\&. In this case all threads will have separate data\&. \fP"
.ti -1c
.RI "int \fBpthread_key_delete\fP (\fBpthread_key_t\fP key)"
.br
.RI "\fIDelete data key and destructor associated with \fCkey\fP\&. After key deletion there is no destructor will be called on thread exits\&. \fP"
.ti -1c
.RI "int \fBpthread_mutexattr_init\fP (\fBpthread_mutexattr_t\fP *attr)"
.br
.RI "\fIInitialize mutex attributes object and initialize attributes with default values\&. \fP"
.ti -1c
.RI "int \fBpthread_mutexattr_destroy\fP (\fBpthread_mutexattr_t\fP *attr)"
.br
.RI "\fIDestroy attributes object and make all attribute values are uninitialized\&. \fP"
.ti -1c
.RI "int \fBpthread_mutexattr_gettype\fP (const \fBpthread_mutexattr_t\fP *attr, int *type)"
.br
.RI "\fIGet mutex type attribute associated with \fCattr\fP parameter\&. \fP"
.ti -1c
.RI "int \fBpthread_mutexattr_settype\fP (\fBpthread_mutexattr_t\fP *attr, int type)"
.br
.RI "\fISet mutex type attribute associated with \fCattr\fP parameter\&. \fP"
.ti -1c
.RI "int \fBpthread_mutex_lock\fP (\fBpthread_mutex_t\fP *mutex)"
.br
.RI "\fILock mutex or wait while another thread is unlock currently locked mutex\&. \fP"
.ti -1c
.RI "int \fBpthread_mutex_trylock\fP (\fBpthread_mutex_t\fP *mutex)"
.br
.RI "\fILock mutex or fail if mutex is already locked\&. \fP"
.ti -1c
.RI "int \fBpthread_mutex_unlock\fP (\fBpthread_mutex_t\fP *mutex)"
.br
.RI "\fIRelease lock on currently locked mutex\&. \fP"
.ti -1c
.RI "int \fBpthread_mutex_destroy\fP (\fBpthread_mutex_t\fP *mutex)"
.br
.RI "\fIDestroy mutex object and make all associated data are uninitialized\&. \fP"
.ti -1c
.RI "int \fBpthread_mutex_init\fP (\fBpthread_mutex_t\fP *mutex, const \fBpthread_mutexattr_t\fP *attr)"
.br
.RI "\fIInitialize mutex object \fCmutex\fP with attributes given by \fCattr\fP parameter\&. If \fCattr\fP parameter is NULL then default attributes will be used\&. \fP"
.ti -1c
.RI "int \fBpthread_cond_destroy\fP (\fBpthread_cond_t\fP *cond)"
.br
.RI "\fIDestroy conditional variable object and make it unitialized\&. \fP"
.ti -1c
.RI "int \fBpthread_cond_init\fP (\fBpthread_cond_t\fP *cond, const \fBpthread_condattr_t\fP *attr)"
.br
.RI "\fIInitialize conditional variable object \fCcond\fP with attributes given by \fCattr\fP parameter\&. \fP"
.ti -1c
.RI "int \fBpthread_cond_signal\fP (\fBpthread_cond_t\fP *cond)"
.br
.RI "\fIUnblock at least one of the threads that are blocked on the specified condition variable \fCcond\fP (if any threads are blocked on \fCcond\fP)\&. \fP"
.ti -1c
.RI "int \fBpthread_cond_broadcast\fP (\fBpthread_cond_t\fP *cond)"
.br
.RI "\fIWake up all threads locked by conditional variable \fCcond\fP\&. \fP"
.ti -1c
.RI "int \fBpthread_cond_wait\fP (\fBpthread_cond_t\fP *cond, \fBpthread_mutex_t\fP *mutex)"
.br
.RI "\fIBlock on condition variable \fCcond\fP, while another thread will unblock this variable by \fBpthread_cond_broadcast()\fP / \fBpthread_cond_signal()\fP call\&. \fP"
.ti -1c
.RI "\fBpthread_t\fP \fBpthread_self\fP (void)"
.br
.RI "\fIObtain ID of the calling thread\&. \fP"
.ti -1c
.RI "int \fBpthread_kill\fP (\fBpthread_t\fP thread, int sig)"
.br
.RI "\fISend signal to specified thread\&. \fP"
.in -1c
.SH "Detailed Description"
.PP 
POSIX compatible thread library\&. 


.PP
\fBCopyright:\fP
.RS 4
(C) 2015, Samsung Electronics Co\&., Ltd\&. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for Samsung Internal API reference from the source code\&.
