pthread Reference

File
lib/pthread/include/pthread.h
Date
Wednesday, June 25, 2014
Includes
  • <system/types/pthread_attr_t.h>
  • <system/types/pthread_barrier_t.h>
  • <system/types/pthread_barrierattr_t.h>
  • <system/types/pthread_cond_t.h>
  • <system/types/pthread_condattr_t.h>
  • <system/types/pthread_key_t.h>
  • <system/types/pthread_mutex_t.h>
  • <system/types/pthread_mutexattr_t.h>
  • <system/types/pthread_once_t.h>
  • <system/types/pthread_rwlock_t.h>
  • <system/types/pthread_rwlockattr_t.h>
  • <system/types/pthread_spinlock_t.h>
  • <system/types/pthread_t.h>
  • <sched.h>
  • <time.h>

Tasks

pthread_atfork

int pthread_atfork( void ( * prepare )( void ), void ( * parent )( void ), void ( * child )( void ) );

pthread_attr_destroy

int pthread_attr_destroy( pthread_attr_t *attr );

pthread_attr_getdetachstate

int pthread_attr_getdetachstate( const pthread_attr_t *attr, int *detachstate );

pthread_attr_getguardsize

int pthread_attr_getguardsize( const pthread_attr_t *restrict attr, size_t *restrict guardsize );

pthread_attr_getinheritsched

int pthread_attr_getinheritsched( const pthread_attr_t *restrict attr, int *restrict inheritsched );

pthread_attr_getschedparam

int pthread_attr_getschedparam( const pthread_attr_t *restrict attr, struct sched_param *restrict param );

pthread_attr_getschedpolicy

int pthread_attr_getschedpolicy( const pthread_attr_t *restrict attr, int *restrict policy );

pthread_attr_getscope

int pthread_attr_getscope( const pthread_attr_t *restrict attr, int *restrict contentionscope );

pthread_attr_getstack

int pthread_attr_getstack( const pthread_attr_t *restrict attr, void **restrict stackaddr, size_t *restrict stacksize );

pthread_attr_getstacksize

int pthread_attr_getstacksize( const pthread_attr_t *restrict attr, size_t *restrict stacksize );

pthread_attr_init

int pthread_attr_init( pthread_attr_t *attr );

pthread_attr_setdetachstate

int pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate );

pthread_attr_setguardsize

int pthread_attr_setguardsize( pthread_attr_t *attr, size_t guardsize );

pthread_attr_setinheritsched

int pthread_attr_setinheritsched( pthread_attr_t *attr, int inheritsched );

pthread_attr_setschedparam

int pthread_attr_setschedparam( pthread_attr_t *restrict attr, const struct sched_param *restrict param );

pthread_attr_setschedpolicy

int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy );

pthread_attr_setscope

int pthread_attr_setscope( pthread_attr_t *attr, int contentionscope );

pthread_attr_setstack

int pthread_attr_setstack( pthread_attr_t *attr, void *stackaddr, size_t stacksize );

pthread_attr_setstacksize

int pthread_attr_setstacksize( pthread_attr_t *attr, size_t stacksize );

pthread_barrier_destroy

int pthread_barrier_destroy( pthread_barrier_t *barrier );

pthread_barrier_init

int pthread_barrier_init( pthread_barrier_t *restrict barrier, const pthread_barrierattr_t *restrict attr, unsigned count );

pthread_barrier_wait

int pthread_barrier_wait( pthread_barrier_t *barrier );

pthread_barrierattr_destroy

int pthread_barrierattr_destroy( pthread_barrierattr_t *attr );

pthread_barrierattr_getpshared

int pthread_barrierattr_getpshared( const pthread_barrierattr_t *restrict attr, int *restrict pshared );

pthread_barrierattr_init

int pthread_barrierattr_init( pthread_barrierattr_t *attr );

pthread_barrierattr_setpshared

int pthread_barrierattr_setpshared( pthread_barrierattr_t *attr, int pshared );

pthread_cancel

int pthread_cancel( pthread_t thread );

pthread_cleanup_pop

void pthread_cleanup_pop( int execute );

pthread_cleanup_push

void pthread_cleanup_push( void ( * routine )( void * ), void *arg );

pthread_cond_broadcast

int pthread_cond_broadcast( pthread_cond_t *cond );

pthread_cond_destroy

int pthread_cond_destroy( pthread_cond_t *cond );

pthread_cond_init

int pthread_cond_init( pthread_cond_t *restrict cond, const pthread_condattr_t *restrict attr );

pthread_cond_signal

int pthread_cond_signal( pthread_cond_t *cond );

pthread_cond_timedwait

int pthread_cond_timedwait( pthread_cond_t *restrict cond, pthread_mutex_t *restrict mutex, const struct timespec *restrict abstime );

pthread_cond_wait

int pthread_cond_wait( pthread_cond_t *restrict cond, pthread_mutex_t *restrict mutex );

pthread_condattr_destroy

int pthread_condattr_destroy( pthread_condattr_t *attr );

pthread_condattr_getclock

int pthread_condattr_getclock( const pthread_condattr_t *restrict attr, clockid_t *restrict clock_id );

pthread_condattr_getpshared

int pthread_condattr_getpshared( const pthread_condattr_t *restrict attr, int *restrict pshared );

pthread_condattr_init

int pthread_condattr_init( pthread_condattr_t *attr );

pthread_condattr_setclock

int pthread_condattr_setclock( pthread_condattr_t *attr, clockid_t clock_id );

pthread_condattr_setpshared

int pthread_condattr_setpshared( pthread_condattr_t *attr, int pshared );

pthread_create

int pthread_create( pthread_t *restrict thread, const pthread_attr_t *restrict attr, void *( * start_routine )( void * ), void *restrict arg );

pthread_detach

int pthread_detach( pthread_t thread );

pthread_equal

int pthread_equal( pthread_t t1, pthread_t t2 );

pthread_exit

void pthread_exit( void *value_ptr );

pthread_getconcurrency

int pthread_getconcurrency( void );

pthread_getcpuclockid

int pthread_getcpuclockid( pthread_t thread_id, clockid_t *clock_id );

pthread_getschedparam

int pthread_getschedparam( pthread_t thread, int *restrict policy, struct sched_param *restrict param );

pthread_getspecific

void * pthread_getspecific( pthread_key_t key );

pthread_join

int pthread_join( pthread_t thread, void **value_ptr );

pthread_key_create

int pthread_key_create( pthread_key_t *key, void ( * destructor )( void * ) );

pthread_key_delete

int pthread_key_delete( pthread_key_t key );

pthread_mutex_consistent

int pthread_mutex_consistent( pthread_mutex_t *mutex );

pthread_mutex_destroy

int pthread_mutex_destroy( pthread_mutex_t *mutex );

pthread_mutex_getprioceiling

int pthread_mutex_getprioceiling( const pthread_mutex_t *restrict mutex, int *restrict prioceiling );

pthread_mutex_init

int pthread_mutex_init( pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr );

pthread_mutex_lock

int pthread_mutex_lock( pthread_mutex_t *mutex );

pthread_mutex_setprioceiling

int pthread_mutex_setprioceiling( pthread_mutex_t *restrict mutex, int prioceiling, int *restrict old_ceiling );

pthread_mutex_timedlock

int pthread_mutex_timedlock( pthread_mutex_t *restrict mutex, const struct timespec *restrict abs_timeout );

pthread_mutex_trylock

int pthread_mutex_trylock( pthread_mutex_t *mutex );

pthread_mutex_unlock

int pthread_mutex_unlock( pthread_mutex_t *mutex );

pthread_mutexattr_destroy

int pthread_mutexattr_destroy( pthread_mutexattr_t *attr );

pthread_mutexattr_getprioceiling

int pthread_mutexattr_getprioceiling( const pthread_mutexattr_t *restrict attr, int *restrict prioceiling );

pthread_mutexattr_getprotocol

int pthread_mutexattr_getprotocol( const pthread_mutexattr_t *restrict attr, int *restrict protocol );

pthread_mutexattr_getpshared

int pthread_mutexattr_getpshared( const pthread_mutexattr_t *restrict attr, int *restrict pshared );

pthread_mutexattr_getrobust

int pthread_mutexattr_getrobust( const pthread_mutexattr_t *restrict attr, int *restrict robust );

pthread_mutexattr_gettype

int pthread_mutexattr_gettype( const pthread_mutexattr_t *restrict attr, int *restrict type );

pthread_mutexattr_init

int pthread_mutexattr_init( pthread_mutexattr_t *attr );

pthread_mutexattr_setprioceiling

int pthread_mutexattr_setprioceiling( pthread_mutexattr_t *attr, int prioceiling );

pthread_mutexattr_setprotocol

int pthread_mutexattr_setprotocol( pthread_mutexattr_t *attr, int protocol );

pthread_mutexattr_setpshared

int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared );

pthread_mutexattr_setrobust

int pthread_mutexattr_setrobust( pthread_mutexattr_t *attr, int robust );

pthread_mutexattr_settype

int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type );

pthread_once

int pthread_once( pthread_once_t *once_control, void ( * init_routine )( void ) );

pthread_rwlock_destroy

int pthread_rwlock_destroy( pthread_rwlock_t *rwlock );

pthread_rwlock_init

int pthread_rwlock_init( pthread_rwlock_t *restrict rwlock, const pthread_rwlockattr_t *restrict attr );

pthread_rwlock_rdlock

int pthread_rwlock_rdlock( pthread_rwlock_t *rwlock );

pthread_rwlock_timedrdlock

int pthread_rwlock_timedrdlock( pthread_rwlock_t *restrict rwlock, const struct timespec *restrict abs_timeout );

pthread_rwlock_timedwrlock

int pthread_rwlock_timedwrlock( pthread_rwlock_t *restrict rwlock, const struct timespec *restrict abs_timeout );

pthread_rwlock_tryrdlock

int pthread_rwlock_tryrdlock( pthread_rwlock_t *rwlock );

pthread_rwlock_trywrlock

int pthread_rwlock_trywrlock( pthread_rwlock_t *rwlock );

pthread_rwlock_unlock

int pthread_rwlock_unlock( pthread_rwlock_t *rwlock );

pthread_rwlock_wrlock

int pthread_rwlock_wrlock( pthread_rwlock_t *rwlock );

pthread_rwlockattr_destroy

int pthread_rwlockattr_destroy( pthread_rwlockattr_t *attr );

pthread_rwlockattr_getpshared

int pthread_rwlockattr_getpshared( const pthread_rwlockattr_t *restrict attr, int *restrict pshared );

pthread_rwlockattr_init

int pthread_rwlockattr_init( pthread_rwlockattr_t *attr );

pthread_rwlockattr_setpshared

int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared );

pthread_self

pthread_t pthread_self( void );

pthread_setcancelstate

int pthread_setcancelstate( int state, int *oldstate );

pthread_setcanceltype

int pthread_setcanceltype( int type, int *oldtype );

pthread_setconcurrency

int pthread_setconcurrency( int new_level );

pthread_setschedparam

int pthread_setschedparam( pthread_t thread, int policy, const struct sched_param *param );

pthread_setspecific

int pthread_setspecific( pthread_key_t key, const void *value );

pthread_spin_destroy

int pthread_spin_destroy( pthread_spinlock_t *lock );

pthread_spin_init

int pthread_spin_init( pthread_spinlock_t *lock, int pshared );

pthread_spin_lock

int pthread_spin_lock( pthread_spinlock_t *lock );

pthread_spin_trylock

int pthread_spin_trylock( pthread_spinlock_t *lock );

pthread_spin_unlock

int pthread_spin_unlock( pthread_spinlock_t *lock );

pthread_testcancel

void pthread_testcancel( void );

Macros

__XEOS_LIB_PTHREAD_PTHREAD_H__

#define __XEOS_LIB_PTHREAD_PTHREAD_H__

PTHREAD_BARRIER_SERIAL_THREAD

#define PTHREAD_BARRIER_SERIAL_THREAD 0x00

PTHREAD_CANCEL_ASYNCHRONOUS

#define PTHREAD_CANCEL_ASYNCHRONOUS 0x03

PTHREAD_CANCEL_DEFERRED

#define PTHREAD_CANCEL_DEFERRED 0x02

PTHREAD_CANCEL_DISABLE

#define PTHREAD_CANCEL_DISABLE 0x00

PTHREAD_CANCEL_ENABLE

#define PTHREAD_CANCEL_ENABLE 0x01

PTHREAD_CANCELED

#define PTHREAD_CANCELED ( ( void * )1 )

PTHREAD_CREATE_DETACHED

#define PTHREAD_CREATE_DETACHED 0x02

PTHREAD_CREATE_JOINABLE

#define PTHREAD_CREATE_JOINABLE 0x01

PTHREAD_EXPLICIT_SCHED

#define PTHREAD_EXPLICIT_SCHED 0x02

PTHREAD_INHERIT_SCHED

#define PTHREAD_INHERIT_SCHED 0x01

PTHREAD_MUTEX_DEFAULT

#define PTHREAD_MUTEX_DEFAULT 0x00

PTHREAD_MUTEX_ERRORCHECK

#define PTHREAD_MUTEX_ERRORCHECK 0x01

PTHREAD_MUTEX_NORMAL

#define PTHREAD_MUTEX_NORMAL 0x00

PTHREAD_MUTEX_RECURSIVE

#define PTHREAD_MUTEX_RECURSIVE 0x02

PTHREAD_MUTEX_ROBUST

#define PTHREAD_MUTEX_ROBUST 0x03

PTHREAD_MUTEX_STALLED

#define PTHREAD_MUTEX_STALLED 0x04

PTHREAD_PRIO_INHERIT

#define PTHREAD_PRIO_INHERIT 0x01

PTHREAD_PRIO_NONE

#define PTHREAD_PRIO_NONE 0x00

PTHREAD_PRIO_PROTECT

#define PTHREAD_PRIO_PROTECT 0x02

PTHREAD_PROCESS_PRIVATE

#define PTHREAD_PROCESS_PRIVATE 0x02

PTHREAD_PROCESS_SHARED

#define PTHREAD_PROCESS_SHARED 0x01

PTHREAD_SCOPE_PROCESS

#define PTHREAD_SCOPE_PROCESS 0x02

PTHREAD_SCOPE_SYSTEM

#define PTHREAD_SCOPE_SYSTEM 0x01