X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Fmtx_trylock.c;h=20efc99403afcc8316c9133ff06a2e9913dc9e0b;hb=62024711e10c2b27e097e0e8876689ae6187e28d;hp=bffc8b85b139b430df32c437585dd70fe06308b5;hpb=8c3db524fec3b6bb85d2a2cc5cd889a63405e5f1;p=pdclib.old diff --git a/opt/nothread/mtx_trylock.c b/opt/nothread/mtx_trylock.c index bffc8b8..20efc99 100644 --- a/opt/nothread/mtx_trylock.c +++ b/opt/nothread/mtx_trylock.c @@ -3,12 +3,8 @@ int mtx_trylock(mtx_t *mtx) { - if(*mtx) { - return thrd_error; - } else { - *mtx = 1; - return thrd_success; - } + (*mtx)++; + return thrd_success; } #endif