add C11 mutex functions

This commit is contained in:
Jens Gustedt
2014-09-06 22:07:22 -04:00
committed by Rich Felker
parent e16f70f452
commit 8b0472932c
6 changed files with 69 additions and 0 deletions

10
src/thread/mtx_init.c Normal file
View File

@ -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;
}