X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2F__lock.c;h=d1717956a6f96f3ec1b0bb490350aab0dad4cf13;hb=d960d4f2cbf18ff3476c7ac03698ec253885dd8e;hp=2e00636f08e8ff80aea0eabddee4972c01e8b9fe;hpb=c2cd25bff89c3581780e7eb267262cb8c4da0d38;p=musl diff --git a/src/thread/__lock.c b/src/thread/__lock.c index 2e00636f..d1717956 100644 --- a/src/thread/__lock.c +++ b/src/thread/__lock.c @@ -2,10 +2,10 @@ void __lock(volatile int *l) { - int spins=100000; + int spins=10000; /* Do not use futexes because we insist that unlocking is a simple * assignment to optimize non-pathological code with no contention. */ - while (a_xchg(l, 1)) + while (a_swap(l, 1)) if (spins) spins--, a_spin(); else __syscall(SYS_sched_yield); }