natPosixProcess.cc (waitForSignal): Use sigsuspend instead of sigwait.

2004-08-18  David Daney  <ddaney@avtrex.com>

	* java/lang/natPosixProcess.cc (waitForSignal): Use sigsuspend
	instead of sigwait.

From-SVN: r86186
This commit is contained in:
David Daney
2004-08-18 15:12:32 +00:00
committed by David Daney
parent 3a4416fb2a
commit 720086cd84
2 changed files with 14 additions and 7 deletions
+9 -7
View File
@@ -130,20 +130,22 @@ java::lang::ConcreteProcess$ProcessManager::waitForSignal ()
sigset_t mask;
// Wait for SIGCHLD
sigemptyset (&mask);
sigaddset (&mask, SIGCHLD);
pthread_sigmask (0, NULL, &mask);
sigdelset (&mask, SIGCHLD);
// Use sigsuspend() instead of sigwait() as sigwait() doesn't play
// nicely with the GC's use of signals.
int c = sigsuspend (&mask);
int sig;
int c = sigwait (&mask, &sig);
if (c != 0)
if (c != -1)
goto error;
if (errno != EINTR)
goto error;
// All OK.
return;
error:
throw new InternalError (JvNewStringUTF (strerror (c)));
throw new InternalError (JvNewStringUTF (strerror (errno)));
}
jboolean java::lang::ConcreteProcess$ProcessManager::reap ()