X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fnothread%2Fmtx_lock.c;fp=opt%2Fnothread%2Fmtx_lock.c;h=0a1afbdc4cdd60bfedf3470d8e0bc2e6f0890c32;hb=97dd2fddbdb56005b16a1b0aa19ed15cd77269fc;hp=0000000000000000000000000000000000000000;hpb=263e1e1fae0dcae08d99dc06fd69391ad076f378;p=pdclib.old diff --git a/opt/nothread/mtx_lock.c b/opt/nothread/mtx_lock.c new file mode 100644 index 0000000..0a1afbd --- /dev/null +++ b/opt/nothread/mtx_lock.c @@ -0,0 +1,10 @@ +#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