소스 검색

optimize spinlock spin

Rich Felker 14 년 전
부모
커밋
c322fe4e1a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/thread/pthread_spin_lock.c

+ 1 - 1
src/thread/pthread_spin_lock.c

@@ -2,6 +2,6 @@
 
 int pthread_spin_lock(pthread_spinlock_t *s)
 {
-	while (a_xchg(s, 1));
+	while (*s || a_xchg(s, 1));
 	return 0;
 }