X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Fmtx_lock.c;h=2c5a26df3bde69ac94390d356cfbfb94c98946c8;hb=4321ebdd142b534d8b7b6c31e01790f77ac46319;hp=d086986555dcd48c6808122333bd51bad77b55fd;hpb=219271fd548949abce8bd75c34dd42e519418fc4;p=pdclib diff --git a/opt/nothread/mtx_lock.c b/opt/nothread/mtx_lock.c index d086986..2c5a26d 100644 --- a/opt/nothread/mtx_lock.c +++ b/opt/nothread/mtx_lock.c @@ -1,21 +1,19 @@ -#ifndef REGTEST -#include - -int mtx_lock(mtx_t *mtx) -{ - if(*mtx == 0) { - *mtx = 1; - return thrd_success; - } else return thrd_error; -} -#endif - -#ifdef TEST -#include <_PDCLIB_test.h> - -int main( void ) -{ - return TEST_RESULTS; -} - -#endif \ No newline at end of file +#ifndef REGTEST +#include + +int mtx_lock(mtx_t *mtx) +{ + (*mtx)++; + return thrd_success; +} +#endif + +#ifdef TEST +#include "_PDCLIB_test.h" + +int main( void ) +{ + return TEST_RESULTS; +} + +#endif