mtx_init.c 212 B

12345678910
  1. #include "pthread_impl.h"
  2. #include <threads.h>
  3. int mtx_init(mtx_t *m, int type)
  4. {
  5. *m = (mtx_t){
  6. ._m_type = ((type&mtx_recursive) ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_NORMAL),
  7. };
  8. return thrd_success;
  9. }