X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2F__lock.c;h=d1717956a6f96f3ec1b0bb490350aab0dad4cf13;hb=1fa05210100caefc8546746e08358d81739f4b41;hp=557c6a62329e856537f4e7fe69e4e447bbd0c1f3;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/thread/__lock.c b/src/thread/__lock.c index 557c6a62..d1717956 100644 --- a/src/thread/__lock.c +++ b/src/thread/__lock.c @@ -1,12 +1,11 @@ -#define SYSCALL_RETURN_ERRNO #include "pthread_impl.h" 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 syscall0(__NR_sched_yield); + else __syscall(SYS_sched_yield); }