X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Fmtx_lock.c;h=cebc07d506551e6b80ae4192d4e5276c6e6d6b2e;hb=da0f3f353d417fed71f358a48d5d5394145e460d;hp=d086986555dcd48c6808122333bd51bad77b55fd;hpb=5fd032eae66fba700cb9927840222b068c62361e;p=pdclib diff --git a/opt/nothread/mtx_lock.c b/opt/nothread/mtx_lock.c index d086986..cebc07d 100644 --- a/opt/nothread/mtx_lock.c +++ b/opt/nothread/mtx_lock.c @@ -3,19 +3,17 @@ 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> +#include "_PDCLIB_test.h" int main( void ) { return TEST_RESULTS; } -#endif \ No newline at end of file +#endif