]> pd.if.org Git - pdclib.old/blobdiff - opt/pthreads/mtx_lock.c
Add pthreads threading backend and move the POSIX port over to using it
[pdclib.old] / opt / pthreads / mtx_lock.c
diff --git a/opt/pthreads/mtx_lock.c b/opt/pthreads/mtx_lock.c
new file mode 100644 (file)
index 0000000..88a1304
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef REGTEST
+#include <threads.h>
+#include <pthread.h>
+
+int mtx_lock(mtx_t *mtx)
+{
+    if(pthread_mutex_lock(mtx))
+        return thrd_error;
+    else return thrd_success;
+}
+#endif
+
+#ifdef TEST
+#include <_PDCLIB_test.h>
+
+int main( void )
+{
+    return TEST_RESULTS;
+}
+
+#endif