Просмотр исходного кода

Fix problem where adding a timer in a timer callback would lock system
and also timer additions were not protected by mutex because of backwards
pthread_equal comparison.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1463 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 18 лет назад
Родитель
Сommit
d0f5ef7ed1
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      exec/timer.c

+ 2 - 2
exec/timer.c

@@ -177,7 +177,7 @@ int openais_timer_add_absolute (
 	int res;
 	int unlock;
 
-	if (pthread_equal (pthread_self(), expiry_thread) == 0) {
+	if (pthread_equal (pthread_self(), expiry_thread) != 0) {
 		unlock = 0;
 	} else {
 		unlock = 1;
@@ -209,7 +209,7 @@ int openais_timer_add_duration (
 	int res;
 	int unlock;
 
-	if (pthread_equal (pthread_self(), expiry_thread) == 0) {
+	if (pthread_equal (pthread_self(), expiry_thread) != 0) {
 		unlock = 0;
 	} else {
 		unlock = 1;