X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fthread%2F__lock.c;h=d1717956a6f96f3ec1b0bb490350aab0dad4cf13;hb=d5fd1fa48564a5528f53e5b1cab5063a0545d7f7;hp=21cb71a84cf9b7c94789319c880aee2b30710d07;hpb=685e40bb09f5f24a2af54ea09c97328808f76990;p=musl diff --git a/src/thread/__lock.c b/src/thread/__lock.c index 21cb71a8..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(__NR_sched_yield); + else __syscall(SYS_sched_yield); }