diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-07-31 16:14:11 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-07-31 16:14:11 +0000 |
commit | 9c2ec3049a5634f1c916d792e81fc80edb669ea8 (patch) | |
tree | 0d634e179761581cadbffe852e7f9a9f049b5c6e /examples/APG/Signals/SigHandlers.cpp | |
parent | 6540653cf736840d5aad719c73a8e43a549080be (diff) | |
download | ATCD-9c2ec3049a5634f1c916d792e81fc80edb669ea8.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-1_4_2'.TAO-1_4_2
Diffstat (limited to 'examples/APG/Signals/SigHandlers.cpp')
-rw-r--r-- | examples/APG/Signals/SigHandlers.cpp | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/examples/APG/Signals/SigHandlers.cpp b/examples/APG/Signals/SigHandlers.cpp deleted file mode 100644 index cb241841a36..00000000000 --- a/examples/APG/Signals/SigHandlers.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// $Id$ - -#include "ace/OS_NS_unistd.h" -#include "ace/Log_Msg.h" -#include "ace/Signal.h" - -class MySignalHandler : public ACE_Event_Handler -{ -public: - MySignalHandler (int signum) : signum_(signum) - { } - - virtual ~MySignalHandler () - { } - - virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0) - { - ACE_TRACE (ACE_TEXT ("MySignalHandler::handle_signal")); - - // Make sure the right handler was called back.. - ACE_ASSERT(signum == this->signum_); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%d occured\n"), signum)); - - return 0; - } - -private: - int signum_; -}; - -// Listing 1 code/ch11 -int ACE_TMAIN (int, ACE_TCHAR *[]) -{ - MySignalHandler h1 (SIGUSR1), h2 (SIGUSR1); - ACE_Sig_Handlers handler; - handler.register_handler (SIGUSR1, &h1); - handler.register_handler (SIGUSR1, &h2); - - ACE_OS::kill (ACE_OS::getpid (), SIGUSR1); - - int time = 10; - while ((time = ACE_OS::sleep (time)) == -1) - { - if (errno == EINTR) - continue; - else - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("sleep")), -1); - } - return 0; -} -// Listing 1 |