X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=opt%2Fpthreads%2Fmtx_lock.c;fp=opt%2Fpthreads%2Fmtx_lock.c;h=88a1304b31ce745f9f25c64a4972511b76940710;hp=0000000000000000000000000000000000000000;hb=d293fb98fe80a472ad4d11b4d8a1413d2142064a;hpb=42ca148113de4800d41cbd0491c508160bb1cf36 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