X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Fmtx_lock.c;h=efe26bd4de6f0b16ae7c706938ff56b4586fed77;hb=66650707acada328341a3812007307b1b9676803;hp=d086986555dcd48c6808122333bd51bad77b55fd;hpb=cce3efd57a644a1fa1ee8fcb14b6b934d40c10d2;p=pdclib diff --git a/opt/nothread/mtx_lock.c b/opt/nothread/mtx_lock.c index d086986..efe26bd 100644 --- a/opt/nothread/mtx_lock.c +++ b/opt/nothread/mtx_lock.c @@ -3,10 +3,8 @@ int mtx_lock(mtx_t *mtx) { - if(*mtx == 0) { - *mtx = 1; - return thrd_success; - } else return thrd_error; + (*mtx)++; + return thrd_success; } #endif