]> pd.if.org Git - pdclib.old/blobdiff - opt/nothread/mtx_lock.c
[dlmalloc] correct definition of MMAP
[pdclib.old] / opt / nothread / mtx_lock.c
index 121444e4b9a255d344825115c0ece923e512d3d7..13b0d1ca6b5089e860d7c897c313da8d3239ca05 100644 (file)
@@ -1,13 +1,12 @@
+#ifndef REGTEST\r
 #include <threads.h>\r
-#include <assert.h>\r
 \r
 int mtx_lock(mtx_t *mtx)\r
 {\r
-       if(*mtx == 0) {\r
-               *mtx = 1;\r
-               return thrd_success;\r
-       } else return thrd_error;\r
+       (*mtx)++;\r
+       return thrd_success;\r
 }\r
+#endif\r
 \r
 #ifdef TEST\r
 #include <_PDCLIB_test.h>\r
@@ -17,4 +16,4 @@ int main( void )
     return TEST_RESULTS;\r
 }\r
 \r
-#endif
\ No newline at end of file
+#endif\r