]> pd.if.org Git - pdclib.old/blob - opt/nothread/mtx_lock.c
_PDCLIB_aux.h: Better detection of Clang and GCC features
[pdclib.old] / opt / nothread / mtx_lock.c
1 #ifndef REGTEST\r
2 #include <threads.h>\r
3 \r
4 int mtx_lock(mtx_t *mtx)\r
5 {\r
6         if(*mtx == 0) {\r
7                 *mtx = 1;\r
8                 return thrd_success;\r
9         } else return thrd_error;\r
10 }\r
11 #endif\r
12 \r
13 #ifdef TEST\r
14 #include <_PDCLIB_test.h>\r
15 \r
16 int main( void )\r
17 {\r
18     return TEST_RESULTS;\r
19 }\r
20 \r
21 #endif