Skip to content

API List

Shuta Kimura edited this page Oct 7, 2018 · 3 revisions

Supported features

Most features are provided in <pthread.h> header file.

Thread operation and scheduling

Interface Name Conforming to Remarks
Type pthread_t POSIX.1-2001
Function pthread_create() POSIX.1-2001
Function pthread_exit() POSIX.1-2001
Function pthread_join() POSIX.1-2001
Function pthread_detach() POSIX.1-2001
Function pthread_self() POSIX.1-2001
Function pthread_equal() POSIX.1-2001
Type pthread_attr_t POSIX.1-2001
Function pthread_attr_init() POSIX.1-2001
Function pthread_attr_destroy() POSIX.1-2001
Function pthread_attr_setdetachstate() POSIX.1-2001
Function pthread_attr_getdetachstate() POSIX.1-2001
Function pthread_attr_setschedparam() POSIX.1-2001
Function pthread_attr_getschedparam() POSIX.1-2001
Function pthread_attr_setschedpolicy() POSIX.1-2001
Function pthread_attr_getschedpolicy() POSIX.1-2001
Function pthread_attr_setstack() POSIX.1-2001
Function pthread_attr_getstack() POSIX.1-2001
Function pthread_attr_setstacksize() POSIX.1-2001
Function pthread_attr_getstacksize() POSIX.1-2001
Function sched_get_priority_max() POSIX.1-2001 <sched.h>
Function sched_get_priority_min() POSIX.1-2001 <sched.h>
Function shced_yield() POSIX.1-2001 <sched.h>

Mutex

Interface Name Conforming to Remarks
Type pthread_mutex_t POSIX.1-2001
Macro PTHREAD_MUTEX_INITIALIZER POSIX.1-2001
Function pthread_mutex_destroy() POSIX.1-2001
Function pthread_mutex_init() POSIX.1-2001
Function pthread_mutex_lock() POSIX.1-2001
Function pthread_mutex_trylock() POSIX.1-2001
Function pthread_mutex_unlock() POSIX.1-2001

Semaphore

Interface Name Conforming to Remarks
Type sem_t POSIX.1-2001 <semaphore.h>
Function sem_destroy() POSIX.1-2001 <semaphore.h>
Function sem_init() POSIX.1-2001 <semaphore.h>
Function sem_post() POSIX.1-2001 <semaphore.h> Can be used in ISR
Function sem_wait() POSIX.1-2001 <semaphore.h>
Function sem_trywait() POSIX.1-2001 <semaphore.h>

Conditional variables

Interface Name Conforming to Remarks
Type pthread_cond_t POSIX.1-2001
Macro PTHREAD_COND_INITIALIZER POSIX.1-2001
Function pthread_cond_destroy() POSIX.1-2001
Function pthread_cond_init() POSIX.1-2001
Function pthread_cond_broadcast() POSIX.1-2001
Function pthread_cond_signal() POSIX.1-2001
Function pthread_cond_wait() POSIX.1-2001

Once control

Interface Name Conforming to Remarks
Type pthread_once_t POSIX.1-2001
Macro PTHREAD_ONCE_INIT POSIX.1-2001
Function pthread_once() POSIX.1-2001

Features outside of pthreads

Interface Name Conforming to Remarks
Function sleep() POSIX.1-2001 <unistd.h>
Function usleep() POSIX.1-2001 <unistd.h>

Non POSIX standard features

Interface Name Conforming to Remarks
Function pthread_getname_np() Nonstandard GNU extension
Function pthread_setname_np() Nonstandard GNU extension

Dropped features

The features below are dropped because they are not useful in "tiny" multi-threading environment. As a general rule, they have never been supported in the future.

  • pthread_atfork()
  • pthread_cancel()
  • pthread_key*()
  • pthread_getspecific()
  • pthread_setspecific()
  • sem_open()
  • sem_unlink()