* 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:
@@ -71,11 +71,11 @@ handle_signals(struct thread *thread, cpu_status *state)
|
|||||||
int i, sig, global_resched = 0;
|
int i, sig, global_resched = 0;
|
||||||
struct sigaction *handler;
|
struct sigaction *handler;
|
||||||
|
|
||||||
// Check, if the thread shall stop for debugging. It will never stop, if
|
// If SIGKILL[THR] are pending, we ignore other signals.
|
||||||
// a SIGKILL[THR] signal is pending.
|
// Otherwise check, if the thread shall stop for debugging.
|
||||||
if (!(signalMask & (1 << (SIGKILL - 1)))
|
if (signalMask & KILL_SIGNALS) {
|
||||||
&& !(signalMask & (1 << (SIGKILLTHR - 1)))
|
signalMask &= KILL_SIGNALS;
|
||||||
&& thread->debug_info.flags & B_THREAD_DEBUG_STOP) {
|
} else if (thread->debug_info.flags & B_THREAD_DEBUG_STOP) {
|
||||||
RELEASE_THREAD_LOCK();
|
RELEASE_THREAD_LOCK();
|
||||||
restore_interrupts(*state);
|
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
|
static status_t
|
||||||
deliver_signal(struct thread *thread, uint signal, uint32 flags)
|
deliver_signal(struct thread *thread, uint signal, uint32 flags)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user