diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-16 04:16:06 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-16 04:16:06 +0000 |
commit | 900f0fc74f1f554c76ee06f94fafe4765126658b (patch) | |
tree | f9f4f02f6bbfd331d481cf0e7a15287b74a30280 /libjava/posix-threads.cc | |
parent | 735cc3dd9476a9058e71fc04e4d87f60b5a89b59 (diff) | |
download | gcc-900f0fc74f1f554c76ee06f94fafe4765126658b.tar.gz |
2005-02-15 David Daney <ddaney@avtrex.com>
Bryce McKinlay <mckinlay@redhat.com>
* prims.cc (_Jv_CreateJavaVM): Add comment about initialization order.
* posix-threads.cc (_Jv_InitThreads): Call block_sigchld() here to
ensure that GC threads inherit the new signal mask.
(block_sigchld): Call JvFail rather than throwing exception if
pthread_sigmask() fails.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95095 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/posix-threads.cc')
-rw-r--r-- | libjava/posix-threads.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/libjava/posix-threads.cc b/libjava/posix-threads.cc index 0643c1a5c7b..91da25cf38d 100644 --- a/libjava/posix-threads.cc +++ b/libjava/posix-threads.cc @@ -281,6 +281,17 @@ handle_intr (int) // Do nothing. } +static void +block_sigchld() +{ + sigset_t mask; + sigemptyset (&mask); + sigaddset (&mask, SIGCHLD); + int c = pthread_sigmask (SIG_BLOCK, &mask, NULL); + if (c != 0) + JvFail (strerror (c)); +} + void _Jv_InitThreads (void) { @@ -296,6 +307,10 @@ _Jv_InitThreads (void) sigemptyset (&act.sa_mask); act.sa_flags = 0; sigaction (INTR, &act, NULL); + + // Block SIGCHLD here to ensure that any non-Java threads inherit the new + // signal mask. + block_sigchld(); } _Jv_Thread_t * @@ -333,17 +348,6 @@ _Jv_ThreadSetPriority (_Jv_Thread_t *data, jint prio) #endif } -static void -block_sigchld() -{ - sigset_t mask; - sigemptyset (&mask); - sigaddset (&mask, SIGCHLD); - int c = pthread_sigmask (SIG_BLOCK, &mask, NULL); - if (c != 0) - throw new java::lang::InternalError (JvNewStringUTF (strerror (c))); -} - void _Jv_ThreadRegister (_Jv_Thread_t *data) { |