diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-10 19:59:37 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-10 19:59:37 +0000 |
commit | 3df4acfa816441fc28a95dee6d0191a927145d95 (patch) | |
tree | b5ae7ca44662cfd8e5c95f1826e4406021a606f5 /examples/Reactor/WFMO_Reactor/Exceptions.cpp | |
parent | 60a5612b83d856fc0adc52b9f39fac9960ec9818 (diff) | |
download | ATCD-pre-subset.tar.gz |
This commit was manufactured by cvs2svn to create tag 'pre-subset'.pre-subset
Diffstat (limited to 'examples/Reactor/WFMO_Reactor/Exceptions.cpp')
-rw-r--r-- | examples/Reactor/WFMO_Reactor/Exceptions.cpp | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/examples/Reactor/WFMO_Reactor/Exceptions.cpp b/examples/Reactor/WFMO_Reactor/Exceptions.cpp deleted file mode 100644 index 20af9b534bf..00000000000 --- a/examples/Reactor/WFMO_Reactor/Exceptions.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// examples -// -// = FILENAME -// Exceptions.cpp -// -// = DESCRIPTION -// -// This test application tests the state of WFMO_Reactor when -// exceptions occurs when executing user callbacks. -// -// The thread count in WFMO_Reactor is used to ensure that state of -// WFMO_Reactor is not fouled up when exceptions occur in user code. -// This example also shows how to write event loops that survive -// user exceptions -// -// = AUTHOR -// Irfan Pyarali -// -// ============================================================================ - -#include "ace/WFMO_Reactor.h" - -ACE_RCSID(WFMO_Reactor, Exceptions, "$Id$") - -class Event_Handler : public ACE_Event_Handler -{ -public: - Event_Handler (void) - : event_ (1) - { - ACE_DEBUG ((LM_DEBUG, - "Event_Handler created\n")); - } - - ~Event_Handler (void) - { - ACE_DEBUG ((LM_DEBUG, - "Event_Handler destroyed\n")); - } - - int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0) - { - char *cause_exception = 0; - char a = *cause_exception; - return 0; - } - - ACE_HANDLE get_handle (void) const - { - return this->event_.handle (); - } -private: - ACE_Manual_Event event_; -}; - -class ACE_WFMO_Reactor_Test -{ -public: - static void doit (ACE_WFMO_Reactor &wfmo_reactor) - { - for (int i = 1; i <= 10; i++) - { - ACE_DEBUG ((LM_DEBUG, - "Active threads in WFMO_Reactor (before handle_events) = %d\n", - wfmo_reactor.active_threads_)); - ACE_SEH_TRY - { - wfmo_reactor.handle_events (); - } - ACE_SEH_EXCEPT (EXCEPTION_EXECUTE_HANDLER) - { - ACE_DEBUG ((LM_DEBUG, - "Exception occurred\n")); - } - ACE_DEBUG ((LM_DEBUG, - "Active threads in WFMO_Reactor (after handle_events) = %d\n", - wfmo_reactor.active_threads_)); - } - } -}; - -int -ACE_TMAIN (int, ACE_TCHAR *[]) -{ - Event_Handler handler; - ACE_WFMO_Reactor wfmo_reactor; - wfmo_reactor.register_handler (&handler); - - ACE_WFMO_Reactor_Test::doit (wfmo_reactor); - - return 0; -} |