Respect SA_NOCLDSTOP.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22101 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-08-28 21:34:05 +00:00
parent dbc03773ef
commit 1273dcaaae
1 changed files with 12 additions and 3 deletions

View File

@ -155,6 +155,10 @@ handle_signals(struct thread *thread)
InterruptsSpinLocker locker(team_spinlock);
team_set_job_control_state(thread->team,
JOB_CONTROL_STATE_CONTINUED, signal, false);
// The standard states that the system *may* send a
// SIGCHLD when a child is continued. I haven't found
// a good reason why we would want to, though.
}
continue;
@ -176,10 +180,15 @@ handle_signals(struct thread *thread)
team_set_job_control_state(thread->team,
JOB_CONTROL_STATE_STOPPED, signal, false);
// send a SIGCHLD to the parent
// send a SIGCHLD to the parent (if it does have
// SA_NOCLDSTOP defined)
SpinLocker _(thread_spinlock);
deliver_signal(thread->team->parent->main_thread,
SIGCHLD, 0);
struct thread* parentThread
= thread->team->parent->main_thread;
struct sigaction& parentHandler
= parentThread->sig_action[SIGCHLD - 1];
if ((parentHandler.sa_flags & SA_NOCLDSTOP) == 0)
deliver_signal(parentThread, SIGCHLD, 0);
}
continue;