2 #define _POSIX_C_SOURCE 2008098L
6 int mtx_init(mtx_t *mtx, int type)
8 if(type == mtx_plain || type == mtx_timed) {
9 if(pthread_mutex_init(mtx, NULL) == 0)
14 } else if (type == mtx_recursive || type == (mtx_recursive | mtx_timed)) {
16 pthread_mutexattr_t attr;
18 if(pthread_mutexattr_init(&attr))
21 if(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE))
24 if(pthread_mutex_init(mtx, &attr) == 0)
28 pthread_mutexattr_destroy(&attr);
38 #include <_PDCLIB_test.h>