]> pd.if.org Git - pdclib/blob - opt/nothread/mtx_lock.c
* Change the style of inclusion of the internal/ headers. Modern preprocessors
[pdclib] / opt / nothread / mtx_lock.c
1 #include <threads.h>\r
2 #include <assert.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 }