home: hub: hare-pthread

ref: 1c557dc95cee8934e942cab92e3f1c85fbf0a9c9
dir: /fns.ha/

View raw version
use rt;
export @symbol("pthread_atfork") fn atfork(_: pthreadfn, _: pthreadfn, _: pthreadfn) int;

export @symbol("pthread_attr_destroy") fn attr_destroy(_: *attr_t) int;
export @symbol("pthread_attr_getstack") fn attr_getstack(_: *attr_t, _: nullable **void, _: *u64) int;
export @symbol("pthread_attr_getstacksize") fn attr_getstacksize(_: const *attr_t, _: *u64) int;
export @symbol("pthread_attr_getstackaddr") fn attr_getstackaddr(_: const *attr_t, _: *u64) int;
export @symbol("pthread_attr_getguardsize") fn attr_getguardsize(_: const *attr_t, _: *u64) int;
export @symbol("pthread_attr_getdetachstate") fn attr_getdetachstate(_: const *attr_t, _: *int) int;
export @symbol("pthread_attr_init") fn attr_init(_: *attr_t) int;
export @symbol("pthread_attr_setstacksize") fn attr_setstacksize(_: *attr_t, _: u64) int;
export @symbol("pthread_attr_setstack") fn attr_setstack(_: *attr_t, _: nullable *void, _: *u64) int;
export @symbol("pthread_attr_setstackaddr") fn attr_setstackaddr(_: *attr_t, _: nullable *void) int;
export @symbol("pthread_attr_setguardsize") fn attr_setguardsize(_: *attr_t, _: u64) int;
export @symbol("pthread_attr_setdetachstate") fn attr_setdetachstate(_: *attr_t, _: int) int;

export @symbol("pthread_cleanup_pop") fn cleanup_pop(_: int) void;
export @symbol("pthread_cleanup_push") fn cleanup_push(_: pthreadfn, _: nullable *void) void;

export @symbol("pthread_condattr_destroy") fn condattr_destroy(_: *condattr_t) int;
export @symbol("pthread_condattr_init") fn condattr_init(_: *condattr_t) int;

export @symbol("pthread_cond_broadcast") fn cond_broadcast(_: *cond_t) int;
export @symbol("pthread_cond_destroy") fn cond_destroy(_: *cond_t) int;
export @symbol("pthread_cond_init") fn cond_init(_: *cond_t, _: const *condattr_t) int;
export @symbol("pthread_cond_signal") fn cond_signal(_: *cond_t) int;
export @symbol("pthread_cond_timedwait") fn cond_timedwait(_: *cond_t, _: *mutex_t, _: const *rt::timespec) int;
export @symbol("pthread_cond_wait") fn cond_wait(_: *cond_t, _: *mutex_t) int;

export @symbol("pthread_create") fn create(_: *pthread_t, _: const *attr_t, _: pthreadfn, _: nullable *void) int;
export @symbol("pthread_detach") fn detach(_: pthread_t) int;
export @symbol("pthread_equal") fn equal(_: pthread_t, _: pthread_t) int;
export @symbol("pthread_exit") @noreturn fn exit(_: nullable *void) void;
export @symbol("pthread_getspecific") fn getspecific(_: key_t) nullable *void;
export @symbol("pthread_join") fn join(_: pthread_t, _: nullable **void) int;

export @symbol("pthread_key_create") fn key_create(_: *key_t, _: pthreadfn) int;
export @symbol("pthread_key_delete") fn key_delete(_: key_t) int;

export @symbol("pthread_kill") fn kill(_: pthread_t, _: int) int;

export @symbol("pthread_mutexattr_init") fn mutexattr_init(_: *mutexattr_t) int;
export @symbol("pthread_mutexattr_destroy") fn mutexattr_destroy(_: *mutexattr_t) int;
export @symbol("pthread_mutexattr_gettype") fn mutexattr_gettype(_: *mutexattr_t, _: *int) int;
export @symbol("pthread_mutexattr_settype") fn mutexattr_settype(_: *mutexattr_t, _: int) int;

export @symbol("pthread_mutex_destroy") fn mutex_destroy(_: *mutex_t) int;
export @symbol("pthread_mutex_init") fn mutex_init(_: *mutex_t, _: const *mutexattr_t) int;
export @symbol("pthread_mutex_lock") fn mutex_lock(_: *mutex_t) int;
export @symbol("pthread_mutex_timedlock") fn mutex_timedlock(_: *mutex_t, _: const *rt::timespec) int;
export @symbol("pthread_mutex_trylock") fn mutex_trylock(_: *mutex_t) int;
export @symbol("pthread_mutex_unlock") fn mutex_unlock(_: *mutex_t) int;

export @symbol("pthread_once") fn once(_: *once_t, _: pthreadfn) int;

export @symbol("pthread_rwlock_destroy") fn rwlock_destroy(_: *rwlock_t) int;
export @symbol("pthread_rwlock_init") fn rwlock_init(_: *rwlock_t, _: const *rwlockattr_t) int;
export @symbol("pthread_rwlock_rdlock") fn rwlock_rdlock(_: *rwlock_t) int;
export @symbol("pthread_rwlock_timedrdlock") fn rwlock_timedrdlock(_: *rwlock_t, _: const *rt::timespec) int;
export @symbol("pthread_rwlock_timedwrlock") fn rwlock_timedwrlock(_: *rwlock_t, _: const *rt::timespec) int;
export @symbol("pthread_rwlock_tryrdlock") fn rwlock_tryrdlock(_: *rwlock_t) int;
export @symbol("pthread_rwlock_trywrlock") fn rwlock_trywrlock(_: *rwlock_t) int;
export @symbol("pthread_rwlock_unlock") fn rwlock_unlock(_: *rwlock_t) int;
export @symbol("pthread_rwlock_wrlock") fn rwlock_wrlock(_: *rwlock_t) int;
export @symbol("pthread_rwlockattr_init") fn rwlockattr_init(_: *rwlockattr_t) int;
export @symbol("pthread_rwlockattr_getpshared") fn rwlockattr_getpshared(_: *rwlockattr_t, _: *int) int;
export @symbol("pthread_rwlockattr_setpshared") fn rwlockattr_setpshared(_: *rwlockattr_t, _: *int) int;
export @symbol("pthread_rwlockattr_destroy") fn rwlockattr_destroy(_: *rwlockattr_t) int;

export @symbol("pthread_self") fn self() pthread_t;
export @symbol("pthread_setspecific") fn setspecific(_: key_t, _: nullable *void) int;
export @symbol("pthread_cancel") fn cancel(_: pthread_t) int;
export @symbol("pthread_setcancelstate") fn setcancelstate(_: int, _: *int) int;
export @symbol("pthread_setcanceltype") fn setcanceltype(_: int, _: *int) int;
export @symbol("pthread_testcancel") fn testcancel() void;
export @symbol("pthread_getprio") fn getprio(_: pthread_t) int;
export @symbol("pthread_setprio") fn setprio(_: pthread_t, _: int) int;

export @symbol("pthread_pyield") fn pyield() void;

export @symbol("pthread_mutexattr_getprioceiling") fn mutexattr_getprioceiling(_: *mutexattr_t, _: *int) int;
export @symbol("pthread_mutexattr_setprioceiling") fn mutexattr_setprioceiling(_: *mutexattr_t, _: int) int;

export @symbol("pthread_mutex_getprioceiling") fn mutex_getprioceiling(_: *mutex_t, _: *int) int;
export @symbol("pthread_mutex_setprioceiling") fn mutex_setprioceiling(_: *mutex_t, _: int, _: *int) int;

export @symbol("pthread_mutexattr_getprotocol") fn mutexattr_getprotocol(_: *mutexattr_t, _: *int) int;
export @symbol("pthread_mutexattr_setprotocol") fn mutexattr_setprotocol(_: *mutexattr_t, _: int) int;

export @symbol("pthread_condattr_getclock") fn condattr_getclock(_: *condattr_t, _: *clockid_t) int;
export @symbol("pthread_condattr_setclock") fn condattr_setclock(_: *condattr_t, _: clockid_t) int;

export @symbol("pthread_attr_getinheritsched") fn attr_getinheritsched(_: *attr_t, _: *int) int;
export @symbol("pthread_attr_getschedparam") fn attr_getschedparam(_: *attr_t, _: *sched_param) int;
export @symbol("pthread_attr_getschedpolicy") fn attr_getschedpolicy(_: *attr_t, _: *int) int;
export @symbol("pthread_attr_getscope") fn attr_getscope(_: *attr_t, _: *int) int;
export @symbol("pthread_attr_setinheritsched") fn attr_setinheritsched(_: *attr_t, _: int) int;
export @symbol("pthread_attr_setschedparam") fn attr_setschedparam(_: *attr_t, _: *sched_param) int;
export @symbol("pthread_attr_setschedpolicy") fn attr_setschedpolicy(_: *attr_t, _: int) int;
export @symbol("pthread_attr_setscope") fn attr_setscope(_: *attr_t, _: int) int;

export @symbol("pthread_getschedparam") fn getschedparam(_: *attr_t, _: *int, _: *sched_param) int;
export @symbol("pthread_setschedparam") fn setschedparam(_: *attr_t, _: int, _: *sched_param) int;
export @symbol("pthread_getconcurrency") fn getconcurrency() int;
export @symbol("pthread_setconcurrency") fn setconcurrency(_: int) int;

export @symbol("pthread_barrier_init") fn barrier_init(_: *barrier_t, _: *barrierattr_t, _: uint) int;
export @symbol("pthread_barrier_destroy") fn barrier_destroy(_: *barrier_t) int;
export @symbol("pthread_barrier_wait") fn barrier_wait(_: *barrier_t) int;
export @symbol("pthread_barrierattr_init") fn barrierattr_init(_: *barrierattr_t) int;
export @symbol("pthread_barrierattr_destroy") fn barrierattr_destroy(_: *barrierattr_t) int;
export @symbol("pthread_barrierattr_getpshared") fn barrierattr_getpshared(_: *barrierattr_t, _: *int) int;
export @symbol("pthread_barrierattr_setpshared") fn barrierattr_setpshared(_: *barrierattr_t, _: int) int;

export @symbol("pthread_spin_init") fn spin_init(_: *spinlock_t, _: int) int;
export @symbol("pthread_spin_destroy") fn spin_destroy(_: *spinlock_t) int;
export @symbol("pthread_spin_trylock") fn spin_trylock(_: *spinlock_t) int;
export @symbol("pthread_spin_lock") fn spin_lock(_: *spinlock_t) int;
export @symbol("pthread_spin_unlock") fn spin_unlock(_: *spinlock_t) int;