summaryrefslogtreecommitdiff
path: root/src/threads/mtx_timedlock.c
blob: 80069bc530416656e5f6ea2beb583a753606fb96 (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
28
29
30
31
32
33
#if 0

#include <threads.h>
#include <pthread.h>
#include <errno.h>

int mtx_timedlock(mtx_t *restrict mtx, const struct timespec *restrict ts)
{
	SIGNAL_SAFE(0);
	ASSERT_NOOVERLAP(mtx, sizeof(*mtx), ts, sizeof(*ts));

	switch (pthread_mutex_timedlock(mtx, ts)) {
	case 0:
		return thrd_success;

	case ETIMEDOUT:
		return thrd_timedout;

	default:
		break;
	}

	return thrd_error;
}

__check_2(int, 0, mtx_timedlock, mtx_t * restrict, const struct timespec * restrict)

/*
STDC(201112)
*/


#endif