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