X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Fmtx_lock.c;h=efe26bd4de6f0b16ae7c706938ff56b4586fed77;hb=62024711e10c2b27e097e0e8876689ae6187e28d;hp=121444e4b9a255d344825115c0ece923e512d3d7;hpb=bb22ff7ecd9fe8f4641484df12ad629cd8ee27ac;p=pdclib.old diff --git a/opt/nothread/mtx_lock.c b/opt/nothread/mtx_lock.c index 121444e..efe26bd 100644 --- a/opt/nothread/mtx_lock.c +++ b/opt/nothread/mtx_lock.c @@ -1,13 +1,12 @@ +#ifndef REGTEST #include -#include int mtx_lock(mtx_t *mtx) { - if(*mtx == 0) { - *mtx = 1; - return thrd_success; - } else return thrd_error; + (*mtx)++; + return thrd_success; } +#endif #ifdef TEST #include <_PDCLIB_test.h>