Sfoglia il codice sorgente

Patch from jflesch to fix segfault when using sysv semaphores that the thread
state is checked prior to the semaphore operation, not after it has completed.


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

Steven Dake 16 anni fa
parent
commit
765fa65351
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      exec/coroipcs.c

+ 1 - 1
exec/coroipcs.c

@@ -638,11 +638,11 @@ retry_semwait:
 		sop.sem_op = -1;
 		sop.sem_flg = 0;
 retry_semop:
+		res = semop (conn_info->semid, &sop, 1);
 		if (ipc_thread_active (conn_info) == 0) {
 			coroipcs_refcount_dec (conn_info);
 			pthread_exit (0);
 		}
-		res = semop (conn_info->semid, &sop, 1);
 		if ((res == -1) && (errno == EINTR || errno == EAGAIN)) {
 			stats_api->stats_increment_value (conn_info->stats_handle, "sem_retry_count");
 			goto retry_semop;