X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Fmtx_lock.c;h=13b0d1ca6b5089e860d7c897c313da8d3239ca05;hb=3a2027b97e7a6c7ecb9fcd4c24b4c74459faddbc;hp=0a1afbdc4cdd60bfedf3470d8e0bc2e6f0890c32;hpb=97dd2fddbdb56005b16a1b0aa19ed15cd77269fc;p=pdclib.old diff --git a/opt/nothread/mtx_lock.c b/opt/nothread/mtx_lock.c index 0a1afbd..13b0d1c 100644 --- a/opt/nothread/mtx_lock.c +++ b/opt/nothread/mtx_lock.c @@ -1,10 +1,19 @@ +#ifndef REGTEST #include -#include int mtx_lock(mtx_t *mtx) { - if(*mtx == 0) { - *mtx = 1; - return thrd_success; - } else return thrd_error; -} \ No newline at end of file + (*mtx)++; + return thrd_success; +} +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + return TEST_RESULTS; +} + +#endif