[patch] better SIGINT handling.

Bryce McKinlay bryce@albatross.co.nz
Wed Nov 24 16:44:00 GMT 1999


OK, after messing around with sigwait() and sigsuspend(), I have realised that
the best way is just to remove the explicit sigint blocking from
posix-threads.cc. Linux threads already does the right thing with sigint. It
works perfectly now.

Tom, what was the motivation to include this code in the first place? Does it
fix problems on other platforms (solaris?). 

regards

  [ bryce ]


Index: posix-threads.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/posix-threads.cc,v
retrieving revision 1.13
diff -u -r1.13 posix-threads.cc
--- posix-threads.cc    1999/11/04 16:45:11     1.13
+++ posix-threads.cc    1999/11/25 00:38:59
@@ -269,13 +269,6 @@
   sigemptyset (&act.sa_mask);
   act.sa_flags = 0;
   sigaction (INTR, &act, NULL);
-
-  // Arrange for SIGINT to be blocked to all threads.  It is only
-  // deliverable to the master thread.
-  sigset_t mask;
-  sigemptyset (&mask);
-  sigaddset (&mask, SIGINT);
-  pthread_sigmask (SIG_BLOCK, &mask, NULL);
 }
 
 void
@@ -366,12 +359,6 @@
 void
 _Jv_ThreadWait (void)
 {
-  // Arrange for SIGINT to be delivered to the master thread.
-  sigset_t mask;
-  sigemptyset (&mask);
-  sigaddset (&mask, SIGINT);
-  pthread_sigmask (SIG_UNBLOCK, &mask, NULL);
-
   pthread_mutex_lock (&daemon_mutex);
   if (non_daemon_count)
     pthread_cond_wait (&daemon_cond, &daemon_mutex);


More information about the Java-patches mailing list