This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: ProcessManager on Solaris
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Cc: java-patches at gcc dot gnu dot org
- Date: Tue, 15 Feb 2005 19:22:36 -0500
- Subject: Re: ProcessManager on Solaris
- References: <200502152111.41174.ebotcazou@libertysurf.fr> <42125F44.3030604@redhat.com> <200502160029.48156.ebotcazou@libertysurf.fr>
Eric Botcazou wrote:
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.
------------------------------------------------------------------------
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);
Its might be worth surrounding this with:
/* GCJ LOCAL */
and
/* END GCJ LOCAL */
just to mark this as a deliberate divergance and avoid merge confusion
later.
Otherwise, ok to commit.
Thanks
Bryce