Debug output now uses the TRACE() macro, turned debug output off.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9942 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+18
-10
@@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2002, Angelo Mottola, [email protected]. All rights reserved.
|
* Copyright 2002, Angelo Mottola, [email protected].
|
||||||
** Copyright 2002-2004, The Haiku Team. All rights reserved.
|
* Copyright 2002-2004, Axel Dörfler, [email protected].
|
||||||
**
|
*
|
||||||
** Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* POSIX signals handling routines */
|
/* POSIX signals handling routines */
|
||||||
|
|
||||||
@@ -20,6 +20,14 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
//#define TRACE_SIGNAL
|
||||||
|
#ifdef TRACE_SIGNAL
|
||||||
|
# define TRACE(x) dprintf x
|
||||||
|
#else
|
||||||
|
# define TRACE(x) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define SIGNAL_TO_MASK(signal) (1LL << (signal - 1))
|
#define SIGNAL_TO_MASK(signal) (1LL << (signal - 1))
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +57,7 @@ handle_signals(struct thread *thread, int state)
|
|||||||
signalMask >>= 1;
|
signalMask >>= 1;
|
||||||
thread->sig_pending &= ~(1L << i);
|
thread->sig_pending &= ~(1L << i);
|
||||||
|
|
||||||
dprintf("Thread 0x%lx received signal %s\n", thread->id, sigstr[sig]);
|
TRACE(("Thread 0x%lx received signal %s\n", thread->id, sigstr[sig]));
|
||||||
|
|
||||||
if (handler->sa_handler == SIG_IGN) {
|
if (handler->sa_handler == SIG_IGN) {
|
||||||
// signal is to be ignored
|
// signal is to be ignored
|
||||||
@@ -78,7 +86,7 @@ handle_signals(struct thread *thread, int state)
|
|||||||
case SIGABRT:
|
case SIGABRT:
|
||||||
case SIGFPE:
|
case SIGFPE:
|
||||||
case SIGSEGV:
|
case SIGSEGV:
|
||||||
dprintf("Shutting down thread 0x%lx due to signal #%d\n", thread->id, sig);
|
TRACE(("Shutting down thread 0x%lx due to signal #%d\n", thread->id, sig));
|
||||||
case SIGKILL:
|
case SIGKILL:
|
||||||
case SIGKILLTHR:
|
case SIGKILLTHR:
|
||||||
default:
|
default:
|
||||||
@@ -105,7 +113,7 @@ handle_signals(struct thread *thread, int state)
|
|||||||
// and may page fault.
|
// and may page fault.
|
||||||
|
|
||||||
// User defined signal handler
|
// User defined signal handler
|
||||||
dprintf("### Setting up custom signal handler frame...\n");
|
TRACE(("### Setting up custom signal handler frame...\n"));
|
||||||
arch_setup_signal_frame(thread, handler, sig, thread->sig_block_mask);
|
arch_setup_signal_frame(thread, handler, sig, thread->sig_block_mask);
|
||||||
|
|
||||||
if (handler->sa_flags & SA_ONESHOT)
|
if (handler->sa_flags & SA_ONESHOT)
|
||||||
@@ -366,7 +374,7 @@ alarm_event(timer *t)
|
|||||||
struct thread *thread = (struct thread *)((uint8 *)t - offsetof(struct thread, alarm));
|
struct thread *thread = (struct thread *)((uint8 *)t - offsetof(struct thread, alarm));
|
||||||
// ToDo: investigate adding one user parameter to the timer structure to fix this hack
|
// ToDo: investigate adding one user parameter to the timer structure to fix this hack
|
||||||
|
|
||||||
dprintf("alarm_event: thread = %p\n", thread);
|
TRACE(("alarm_event: thread = %p\n", thread));
|
||||||
send_signal_etc(thread->id, SIGALRM, B_DO_NOT_RESCHEDULE);
|
send_signal_etc(thread->id, SIGALRM, B_DO_NOT_RESCHEDULE);
|
||||||
|
|
||||||
return B_INVOKE_SCHEDULER;
|
return B_INVOKE_SCHEDULER;
|
||||||
@@ -382,7 +390,7 @@ set_alarm(bigtime_t time, uint32 mode)
|
|||||||
ASSERT(B_ONE_SHOT_RELATIVE_ALARM == B_ONE_SHOT_RELATIVE_TIMER);
|
ASSERT(B_ONE_SHOT_RELATIVE_ALARM == B_ONE_SHOT_RELATIVE_TIMER);
|
||||||
// just to be sure no one changes the headers some day
|
// just to be sure no one changes the headers some day
|
||||||
|
|
||||||
dprintf("set_alarm: thread = %p\n", thread);
|
TRACE(("set_alarm: thread = %p\n", thread));
|
||||||
|
|
||||||
if (thread->alarm.period)
|
if (thread->alarm.period)
|
||||||
rv = (bigtime_t)thread->alarm.entry.key - system_time();
|
rv = (bigtime_t)thread->alarm.entry.key - system_time();
|
||||||
|
|||||||
Reference in New Issue
Block a user