5 int mtx_init(mtx_t *mtx, int type)
7 if(type == mtx_plain || type == mtx_timed) {
8 if(pthread_mutex_init(mtx, NULL) == 0)
13 } else if (type == mtx_recursive || type == (mtx_recursive | mtx_timed)) {
15 pthread_mutexattr_t attr;
17 if(pthread_mutexattr_init(&attr))
20 if(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE))
23 if(pthread_mutex_init(mtx, &attr) == 0)
27 pthread_mutexattr_destroy(&attr);
37 #include <_PDCLIB_test.h>