1 #include "ace/OS_NS_unistd.h"
2 #include "ace/Log_Msg.h"
3 #include "ace/Signal.h"
4 #include "ace/Sig_Handler.h"
7 class MySignalHandler
: public ACE_Event_Handler
10 virtual int handle_signal(int signo
, siginfo_t
* = 0, ucontext_t
* = 0)
12 ACE_DEBUG ((LM_DEBUG
, ACE_TEXT ("Signal %d\n"), signo
));
17 int ACE_TMAIN (int, ACE_TCHAR
*[])
19 MySignalHandler sighandler
;
21 sh
.register_handler (SIGUSR1
, &sighandler
);
26 ACE_Sig_Guard
guard (&ss
);
29 ACE_TEXT ("Entering critical region\n")));
32 ACE_TEXT ("Leaving critical region\n")));