소스 검색

minor locking optimizations

Rich Felker 13 년 전
부모
커밋
6232b96f51
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/thread/__lock.c
  2. 1 1
      src/thread/pthread_create.c

+ 1 - 1
src/thread/__lock.c

@@ -2,7 +2,7 @@
 
 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))

+ 1 - 1
src/thread/pthread_create.c

@@ -22,7 +22,7 @@ void __pthread_unwind_next(struct __ptcb *cb)
 		longjmp((void *)cb->__next->__jb, 1);
 	}
 
-	LOCK(&self->exitlock);
+	__lock(&self->exitlock);
 
 	__pthread_tsd_run_dtors();