blob: f363b2556255fcde69220efcfbdad41010c9979c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#if 0
#include <threads.h>
#include <pthread.h>
#include <errno.h>
int mtx_init(mtx_t *mtx, int type)
{
SIGNAL_SAFE(0);
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
if (type & mtx_recursive) {
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
} else {
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_DEFAULT);
}
return pthread_mutex_init(mtx, &attr) == 0 ? thrd_success : thrd_error;
}
CHECK_2(int, 0, mtx_init, mtx_t *, int)
/*
STDC(201112)
*/
#endif
|