* handle_signals(): If a SIGKILL[THR] is pending, ignore other signal.

* Added is_kill_signal_pending(). Can anyone tell me why the compiler
  complains about a missing previous prototype for it? <ksignal.h> is
  included, and when only preprocessing the file, the prototype is clearly
  there. I'm clueless.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11488 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2005-02-25 14:20:47 +00:00
parent 782c98afd9
commit f75dc555fd

View File

@ -71,11 +71,11 @@ handle_signals(struct thread *thread, cpu_status *state)
int i, sig, global_resched = 0;
struct sigaction *handler;
// Check, if the thread shall stop for debugging. It will never stop, if
// a SIGKILL[THR] signal is pending.
if (!(signalMask & (1 << (SIGKILL - 1)))
&& !(signalMask & (1 << (SIGKILLTHR - 1)))
&& thread->debug_info.flags & B_THREAD_DEBUG_STOP) {
// If SIGKILL[THR] are pending, we ignore other signals.
// Otherwise check, if the thread shall stop for debugging.
if (signalMask & KILL_SIGNALS) {
signalMask &= KILL_SIGNALS;
} else if (thread->debug_info.flags & B_THREAD_DEBUG_STOP) {
RELEASE_THREAD_LOCK();
restore_interrupts(*state);
@ -200,6 +200,24 @@ handle_signals(struct thread *thread, cpu_status *state)
}
bool
is_kill_signal_pending()
{
bool result;
struct thread *thread = thread_get_current_thread();
cpu_status state = disable_interrupts();
GRAB_THREAD_LOCK();
result = (thread->sig_pending & KILL_SIGNALS);
RELEASE_THREAD_LOCK();
restore_interrupts(state);
return result;
}
static status_t
deliver_signal(struct thread *thread, uint signal, uint32 flags)
{