summaryrefslogtreecommitdiff
path: root/src/thread/mtx_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread/mtx_init.c')
-rw-r--r--src/thread/mtx_init.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/thread/mtx_init.c b/src/thread/mtx_init.c
new file mode 100644
index 00000000..4826f76b
--- /dev/null
+++ b/src/thread/mtx_init.c
@@ -0,0 +1,10 @@
+#include "pthread_impl.h"
+#include <threads.h>
+
+int mtx_init(mtx_t *m, int type)
+{
+ *m = (mtx_t){
+ ._m_type = ((type&mtx_recursive) ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_NORMAL),
+ };
+ return thrd_success;
+}