home: hub: hare-pthread

ref: 64ffaa9478079576c0b5be8ab133cd013512588b
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 **opaque, *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 *opaque, *u64) int;
export @symbol("pthread_attr_setstackaddr") fn attr_setstackaddr(*attr_t, nullable *opaque) 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 *opaque) 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 *opaque) 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") fn exit(nullable *opaque) never;
export @symbol("pthread_getspecific") fn getspecific(key_t) nullable *opaque;
export @symbol("pthread_join") fn join(pthread_t, nullable **opaque) 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 *opaque) 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;