typedef pthread_t = ulong;
typedef pthread_attr_t = void;
typedef pthread_barrier_t = void;
typedef pthread_barrierattr_t = void;
typedef pthread_cond_t = void;
typedef pthread_condattr_t = void;
typedef pthread_key_t = uint;
typedef pthread_mutex_t = void;
typedef pthread_mutexattr_t = void;
typedef pthread_once_t = void;
typedef pthread_rwlock_t = void;
typedef pthread_rwlockattr_t = void;
typedef pthread_spinlock_t = void;

typedef pthread_barrier_e = enum[int](PTHREAD_BARRIER_SERIAL_THREAD=-1);
typedef pthread_cancel_state_e = enum[int](PTHREAD_CANCEL_DISABLE=1, PTHREAD_CANCEL_ENABLE=0);
typedef pthread_cancel_type_e = enum[int](PTHREAD_CANCEL_ASYNCHRONOUS=1, PTHREAD_CANCEL_DEFERRED=0);
typedef pthread_detach_state_e = enum[int](PTHREAD_CREATE_DETACHED=1, PTHREAD_CREATE_JOINABLE=0);
typedef pthread_inherit_sched_e = enum[int](PTHREAD_EXPLICIT_SCHED=1, PTHREAD_INHERIT_SCHED=0);
typedef pthread_mutex_protocol_e = enum[int](PTHREAD_PRIO_INHERIT=1, PTHREAD_PRIO_NONE=0, PTHREAD_PRIO_PROTECT=2);
typedef pthread_mutex_robust_e = enum[int](PTHREAD_MUTEX_ROBUST=1, PTHREAD_MUTEX_STALLED=0);
typedef pthread_mutex_type_e = enum[int](PTHREAD_MUTEX_ADAPTIVE_NP=3, PTHREAD_MUTEX_ERRORCHECK=2, PTHREAD_MUTEX_NORMAL=0, PTHREAD_MUTEX_RECURSIVE=1);
typedef pthread_pshared_e = enum[int](PTHREAD_PROCESS_SHARED=1, PTHREAD_PROCESS_PRIVATE=0);
typedef pthread_rwlock_kind_e = enum[int](PTHREAD_RWLOCK_PREFER_READER_NP=0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP=2, PTHREAD_RWLOCK_PREFER_WRITER_NP=1);
typedef pthread_scope_e = enum[int](PTHREAD_SCOPE_PROCESS=1, PTHREAD_SCOPE_SYSTEM=0);
