#include "pthread_impl.h" #include int mtx_init(mtx_t * m, int type) { *m = (mtx_t) { ._mx_type = ((type&mtx_recursive) ? PTHREAD_MUTEX_RECURSIVE : 0), }; __mtx_t* ret = __mtx_getref(m); __mtx_unref(ret); return ret ? thrd_success : thrd_error; }