minor locking optimizations
authorRich Felker <dalias@aerifal.cx>
Tue, 14 Jun 2011 05:23:42 +0000 (01:23 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 14 Jun 2011 05:23:42 +0000 (01:23 -0400)
src/thread/__lock.c
src/thread/pthread_create.c

index 2e00636..21c85fc 100644 (file)
@@ -2,7 +2,7 @@
 
 void __lock(volatile int *l)
 {
 
 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))
        /* 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))
index a645f9f..d1eea0c 100644 (file)
@@ -22,7 +22,7 @@ void __pthread_unwind_next(struct __ptcb *cb)
                longjmp((void *)cb->__next->__jb, 1);
        }
 
                longjmp((void *)cb->__next->__jb, 1);
        }
 
-       LOCK(&self->exitlock);
+       __lock(&self->exitlock);
 
        __pthread_tsd_run_dtors();
 
 
        __pthread_tsd_run_dtors();