]> pd.if.org Git - pdclib/blob - opt/nothread/mtx_trylock.c
* Change the style of inclusion of the internal/ headers. Modern preprocessors
[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