The ACE_MANUAL_EVENT class wakes up all the threads that are waiting, and reset the signal common constructor: ACE_MANUAL_EVENT (1) Table The current object is ready, once the thread is waiting, it will trigger and reset the event.
Abnormal Processing Syntax Structure: ACE_SEH_TRY {/ / Canada code} ACE_SEH_EXCEPT (Exception_execute_Handler) {// After an abnormal process}
Example (from the example of ACE comes with)
#include "ace / wfmo_reactor.h"
ACE_RCSID (Wfmo_reactor, Exceptions, "Exceptions.cpp, V 4.1 2002/04/25 04:40:42 Irfan Exp")
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 sign, 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_));}}}; INTACE_TMAIN (int, ACE_TCHAR * []) {Event_Handler Handler; ACE_WFMO_REACTOR WFMO_REACTOR; WFMO_REACTOR.REGISTER_HANDLER (& Handler);
ACE_WFMO_RAAACTOR_TEST :: DOIT (WFMO_REACTOR);
Return 0;}