summaryrefslogtreecommitdiff
path: root/src/threads/mtx_trylock.c
blob: 3571504d6a457c2fe155b4d9379f7f3e11b54308 (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
#if 0

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

int mtx_trylock(mtx_t *mtx)
{
	SIGNAL_SAFE(0);
	switch (pthread_mutex_trylock(mtx)) {
	case 0:
		return thrd_success;

	case EBUSY:
		return thrd_busy;

	default:
		break;
	}

	return thrd_error;
}

CHECK_1(int, 0, mtx_trylock, mtx_t *)

/*
STDC(201112)
*/


#endif