X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Fmtx_lock.c;h=13b0d1ca6b5089e860d7c897c313da8d3239ca05;hb=29387e76cd5cd340fe7d811dc9830931d3d0ec9b;hp=121444e4b9a255d344825115c0ece923e512d3d7;hpb=5155ca96295a12b4857fc0e6a9629cc43a9a85fa;p=pdclib diff --git a/opt/nothread/mtx_lock.c b/opt/nothread/mtx_lock.c index 121444e..13b0d1c 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> @@ -17,4 +16,4 @@ int main( void ) return TEST_RESULTS; } -#endif \ No newline at end of file +#endif