This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: ProcessManager on Solaris
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Bryce McKinlay <mckinlay at redhat dot com>
- Cc: java at gcc dot gnu dot org,java-patches at gcc dot gnu dot org
- Date: Wed, 16 Feb 2005 00:31:14 +0100
- Subject: Re: ProcessManager on Solaris
- References: <200502152111.41174.ebotcazou@libertysurf.fr> <42125F44.3030604@redhat.com>
> It should be pretty trival to fix boehm-gc to block SIGCHLD. Basically
> you should just need to copy the pthread_sigmask() code from
> block_sigchld in posix-threads.cc into GC_pthread_create in
> solaris_pthreads.c. I think it would be fine to make that change in
> order to fix this problem, so please submit a patch.
Indeed, if I'm allowed to directly patch Boehm GC, the fix is trivial.
Attached, tested on SPARC64/Solaris 9.
2005-02-16 Eric Botcazou <ebotcazou@libertysurf.fr>
* solaris_threads.c (GC_thr_daemon): Block SIGCHLD.
--
Eric Botcazou
Index: solaris_threads.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/solaris_threads.c,v
retrieving revision 1.12
diff -u -p -r1.12 solaris_threads.c
--- solaris_threads.c 16 Aug 2004 16:32:26 -0000 1.12
+++ solaris_threads.c 15 Feb 2005 23:09:05 -0000
@@ -743,7 +743,13 @@ void * GC_thr_daemon(void * dummy)
register GC_thread t;
register int i;
register int result;
-
+ sigset_t mask;
+
+ /* Libgcj's ProcessManager requires that SIGCHLD be delivered to it. */
+ sigemptyset (&mask);
+ sigaddset (&mask, SIGCHLD);
+ thr_sigsetmask (SIG_BLOCK, &mask, NULL);
+
for(;;) {
start:
result = thr_join((thread_t)0, &departed, &status);