]> pd.if.org Git - pdclib/blobdiff - opt/nothread/mtx_trylock.c
PDCLib includes with quotes, not <>.
[pdclib] / opt / nothread / mtx_trylock.c
index ae3275775046114800efb65ddebb12c0a4d752bd..3224e4732654c598b0fefda211fe3da2e18a8c1e 100644 (file)
@@ -1,11 +1,19 @@
+#ifndef REGTEST\r
 #include <threads.h>\r
 \r
 int mtx_trylock(mtx_t *mtx)\r
 {\r
-       if(*mtx) {\r
-               return thrd_error;\r
-       } else {\r
-               *mtx = 1;\r
-               return thrd_success;\r
-       }\r
+       (*mtx)++;\r
+       return thrd_success;\r
 }\r
+#endif\r
+\r
+#ifdef TEST\r
+#include "_PDCLIB_test.h"\r
+\r
+int main( void )\r
+{\r
+    return TEST_RESULTS;\r
+}\r
+\r
+#endif\r