X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fpthreads%2Fmtx_lock.c;fp=opt%2Fpthreads%2Fmtx_lock.c;h=88a1304b31ce745f9f25c64a4972511b76940710;hb=a3b310f13d9001554fe24f3eebab8c0bebac72ca;hp=0000000000000000000000000000000000000000;hpb=c2d0eabd70beb268554939e4cc7fdc0732b21141;p=pdclib diff --git a/opt/pthreads/mtx_lock.c b/opt/pthreads/mtx_lock.c new file mode 100644 index 0000000..88a1304 --- /dev/null +++ b/opt/pthreads/mtx_lock.c @@ -0,0 +1,21 @@ +#ifndef REGTEST +#include +#include + +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