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