summaryrefslogtreecommitdiff
path: root/src/threads/mtx_init.c
blob: 43691c3d5b8e182db6d240f9e437c448dd2de9cb (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