[Gc] patch to handle EINTR

Paolo Molaro lupus at debian.org
Tue Jan 18 02:29:15 PST 2005


Just a small patch to handle EINTR when calling sem_wait ().

lupus

Index: pthread_stop_world.c
===================================================================
--- pthread_stop_world.c	(revision 39018)
+++ pthread_stop_world.c	(working copy)
@@ -366,9 +366,11 @@
 	  }
       }
     for (i = 0; i < n_live_threads; i++) {
-	  if (0 != (code = sem_wait(&GC_suspend_ack_sem))) {
-	      GC_err_printf1("Sem_wait returned %ld\n", (unsigned long)code);
-	      ABORT("sem_wait for handler failed");
+	  while (0 != (code = sem_wait(&GC_suspend_ack_sem))) {
+	      if (errno != EINTR) {
+	         GC_err_printf1("Sem_wait returned %ld\n", (unsigned long)code);
+	         ABORT("sem_wait for handler failed");
+	      }
 	  }
     }
     #if DEBUG_THREADS
-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better


More information about the Gc mailing list