Don't allow a SIGCHLD to wake up a thread if the process has the default

signal handler installed for SIGCHLD. The ACE MT_SOCK_Test was hanging
as the result of being interrupted when it didn't expect to be.
This commit is contained in:
John Birrell 1998-06-17 22:29:12 +00:00
parent a5211c115d
commit b9148b8a3e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37045
3 changed files with 27 additions and 18 deletions

View File

@ -292,14 +292,17 @@ _thread_signal(pthread_t pthread, int sig)
case PS_SLEEP_WAIT:
case PS_SIGWAIT:
case PS_SELECT_WAIT:
/* Flag the operation as interrupted: */
pthread->interrupted = 1;
if (sig != SIGCHLD ||
_thread_sigact[sig - 1].sa_handler != SIG_DFL) {
/* Flag the operation as interrupted: */
pthread->interrupted = 1;
/* Change the state of the thread to run: */
PTHREAD_NEW_STATE(pthread,PS_RUNNING);
/* Change the state of the thread to run: */
PTHREAD_NEW_STATE(pthread,PS_RUNNING);
/* Return the signal number: */
pthread->signo = sig;
/* Return the signal number: */
pthread->signo = sig;
}
break;
}
}

View File

@ -292,14 +292,17 @@ _thread_signal(pthread_t pthread, int sig)
case PS_SLEEP_WAIT:
case PS_SIGWAIT:
case PS_SELECT_WAIT:
/* Flag the operation as interrupted: */
pthread->interrupted = 1;
if (sig != SIGCHLD ||
_thread_sigact[sig - 1].sa_handler != SIG_DFL) {
/* Flag the operation as interrupted: */
pthread->interrupted = 1;
/* Change the state of the thread to run: */
PTHREAD_NEW_STATE(pthread,PS_RUNNING);
/* Change the state of the thread to run: */
PTHREAD_NEW_STATE(pthread,PS_RUNNING);
/* Return the signal number: */
pthread->signo = sig;
/* Return the signal number: */
pthread->signo = sig;
}
break;
}
}

View File

@ -292,14 +292,17 @@ _thread_signal(pthread_t pthread, int sig)
case PS_SLEEP_WAIT:
case PS_SIGWAIT:
case PS_SELECT_WAIT:
/* Flag the operation as interrupted: */
pthread->interrupted = 1;
if (sig != SIGCHLD ||
_thread_sigact[sig - 1].sa_handler != SIG_DFL) {
/* Flag the operation as interrupted: */
pthread->interrupted = 1;
/* Change the state of the thread to run: */
PTHREAD_NEW_STATE(pthread,PS_RUNNING);
/* Change the state of the thread to run: */
PTHREAD_NEW_STATE(pthread,PS_RUNNING);
/* Return the signal number: */
pthread->signo = sig;
/* Return the signal number: */
pthread->signo = sig;
}
break;
}
}