]> pd.if.org Git - pdclib/blob - opt/nothread/mtx_trylock.c
ae3275775046114800efb65ddebb12c0a4d752bd
[pdclib] / opt / nothread / mtx_trylock.c
1 #include <threads.h>\r
2 \r
3 int mtx_trylock(mtx_t *mtx)\r
4 {\r
5         if(*mtx) {\r
6                 return thrd_error;\r
7         } else {\r
8                 *mtx = 1;\r
9                 return thrd_success;\r
10         }\r
11 }\r