diff options
33 files changed, 143 insertions, 152 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b index 8bd34522ef3..959d6df00b2 100644 --- a/ChangeLog-98b +++ b/ChangeLog-98b @@ -1,3 +1,9 @@ +Thu Dec 17 12:43:11 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * ace: Removed the use of ACE_DEBUG within handle_signal() methods + to avoid portability problems. Thanks to Susan Liebeskind + <susan.liebeskind@gtri.gatech.edu> for reporting this. + Tue Dec 15 14:45:49 1998 David L. Levine <levine@cs.wustl.edu> * *.h: removed () from #pragma implementation argument. @@ -848,7 +854,7 @@ Mon Nov 23 12:58:47 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> tests: Replaced the improper (though technically correct) use of the rd_ptr() with wr_ptr(). Thanks to Susan Liebeskind - (susan.liebeskind@gtri.gatech.edu) for reporting this. + <susan.liebeskind@gtri.gatech.edu> for reporting this. Mon Nov 23 10:47:38 1998 David L. Levine <levine@cs.wustl.edu> diff --git a/TAO/examples/Callback_Quoter/Consumer_Signal_Handler.cpp b/TAO/examples/Callback_Quoter/Consumer_Signal_Handler.cpp index 2758f27be85..677155babd5 100644 --- a/TAO/examples/Callback_Quoter/Consumer_Signal_Handler.cpp +++ b/TAO/examples/Callback_Quoter/Consumer_Signal_Handler.cpp @@ -37,6 +37,7 @@ Consumer_Signal_Handler::handle_signal (int signum, { ACE_DEBUG ((LM_DEBUG, " Exiting on receiving ^C\n")); + quit_on_signal (); return 0; @@ -53,7 +54,6 @@ Consumer_Signal_Handler::handle_close (ACE_HANDLE, return 0; } - int Consumer_Signal_Handler::quit_on_signal (void) { @@ -70,7 +70,7 @@ Consumer_Signal_Handler::quit_on_signal (void) this->consumer_handler_->server_->unregister_callback (this->consumer_handler_->consumer_var_.in ()); ACE_DEBUG ((LM_DEBUG, - " Consumer Unregistered \n ")); + "Consumer Unregistered\n")); TAO_CHECK_ENV; } this->consumer_handler_->consumer_servant_->shutdown diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp index 26dfbf6229a..babecdf735e 100644 --- a/ace/Acceptor.cpp +++ b/ace/Acceptor.cpp @@ -706,7 +706,6 @@ ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::~ACE_Strategy_Acceptor template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_signal (int, siginfo_t *, ucontext_t *) { - ACE_TRACE ("ACE_Strategy_Acceptor::handle_signal"); ACE_Reactor::end_event_loop (); return 0; } diff --git a/ace/Memory_Pool.cpp b/ace/Memory_Pool.cpp index 14577fd867c..f1b0cf59719 100644 --- a/ace/Memory_Pool.cpp +++ b/ace/Memory_Pool.cpp @@ -237,10 +237,11 @@ ACE_MMAP_Memory_Pool::map_file (off_t file_offset) if (this->mmap_.map (file_offset, PROT_RDWR, this->flags_, this->base_addr_, 0, this->sa_) == -1 || this->base_addr_ != 0 && this->mmap_.addr () != this->base_addr_) - ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("(%P|%t) addr = %u, base_addr = %u, file_offset = %u, %p\n"), - this->mmap_.addr (), this->base_addr_, - file_offset, this->backing_store_name_), -1); + return -1; + // ACE_ERROR_RETURN ((LM_ERROR, + // ASYS_TEXT ("(%P|%t) addr = %u, base_addr = %u, file_offset = %u, %p\n"), + // this->mmap_.addr (), this->base_addr_, + // file_offset, this->backing_store_name_), -1); return 0; } @@ -374,12 +375,8 @@ base_addr_ = (void *)temp; int ACE_MMAP_Memory_Pool::handle_signal (int signum, siginfo_t *siginfo, ucontext_t *) { - ACE_TRACE ("ACE_MMAP_Memory_Pool::handle_signal"); - if (signum != SIGSEGV) - ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("(%P|%t) ignoring signal %S\n"), - signum), -1); + return -1; else ; // ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) received %S\n"), signum)); @@ -393,8 +390,9 @@ ACE_MMAP_Memory_Pool::handle_signal (int signum, siginfo_t *siginfo, ucontext_t { // ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) si_signo = %d, si_code = %d, addr = %u\n"), siginfo->si_signo, siginfo->si_code, siginfo->si_addr)); if (this->remap ((void *) siginfo->si_addr) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) address %u out of range\n", - siginfo->si_addr), -1); + return -1; + // ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) address %u out of range\n", + // siginfo->si_addr), -1); return 0; } #else diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp index 9bb266c5951..1e3d7569750 100644 --- a/ace/Proactor.cpp +++ b/ace/Proactor.cpp @@ -716,16 +716,20 @@ ACE_Proactor::handle_signal (int, siginfo_t *, ucontext_t *) ACE_Time_Value timeout (0, 0); int result = 0; - while (1) + for (;;) { result = this->handle_events (timeout); + if (result != 0 || errno == ETIME) break; } // If our handle_events failed, we'll report a failure to the // Reactor. - return result == -1 ? -1 : 0; + if (result == -1) + return -1; + else + return 0; } int diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index 9d1780e9edd..78637656ef0 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -629,17 +629,7 @@ ACE_Service_Config::handle_signal (int sig, siginfo_t *, ucontext_t *) { - ACE_TRACE ("ACE_Service_Config::handle_signal"); - - if (ACE_Service_Config::signum_ != sig) - ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("error, signal %S does match %S\n"), - sig, - ACE_Service_Config::signum_)); - if (ACE::debug ()) - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("signal %S occurred\n"), - sig)); + ACE_ASSERT (ACE_Service_Config::signum_ == sig); ACE_Service_Config::reconfig_occurred_ = 1; } diff --git a/ace/Service_Manager.cpp b/ace/Service_Manager.cpp index 5fa21efae46..506c0ed74b6 100644 --- a/ace/Service_Manager.cpp +++ b/ace/Service_Manager.cpp @@ -143,17 +143,8 @@ ACE_Service_Manager::get_handle (void) const } int -ACE_Service_Manager::handle_signal (int sig, siginfo_t *, ucontext_t *) +ACE_Service_Manager::handle_signal (int, siginfo_t *, ucontext_t *) { -#if defined (ACE_NLOGGING) - ACE_UNUSED_ARG (sig); -#endif /* ACE_NLOGGING */ - - ACE_TRACE ("ACE_Service_Manager::handle_signal"); - if (this->debug_) - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("got %S\n"), - sig)); return 0; } diff --git a/ace/Timer_Queue_Adapters.cpp b/ace/Timer_Queue_Adapters.cpp index 1a91e1cf1bd..4c79dfff68f 100644 --- a/ace/Timer_Queue_Adapters.cpp +++ b/ace/Timer_Queue_Adapters.cpp @@ -118,9 +118,6 @@ ACE_Async_Timer_Queue_Adapter<TQ>::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("handling signal %S\n"), - signum)); switch (signum) { case SIGALRM: @@ -131,15 +128,9 @@ ACE_Async_Timer_Queue_Adapter<TQ>::handle_signal (int signum, // @@ We need to figure out how to implement interval timers... expired_timers = this->timer_queue_.expire (); - if (expired_timers > 0) - ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("time = %d, timers expired = %d\n"), - ACE_OS::time (), - expired_timers)); - - // Only schedule a new timer if there is one in the list. - // @@ This code should also become smarter to avoid - // unnecessary calls to ualarm(). + // Only schedule a new timer if there is one in the list. @@ + // This code should also become smarter to avoid unnecessary + // calls to ualarm(). if (this->timer_queue_.is_empty () == 0) return this->schedule_ualarm (); else @@ -147,7 +138,10 @@ ACE_Async_Timer_Queue_Adapter<TQ>::handle_signal (int signum, /* NOTREACHED */ } default: - ACE_ERROR_RETURN ((LM_ERROR, "unexpected signal %S\n", signum), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "unexpected signal %S\n", + signum), + -1); /* NOTREACHED */ } } diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp index 62df0699342..ddb03e7d922 100644 --- a/ace/WFMO_Reactor.cpp +++ b/ace/WFMO_Reactor.cpp @@ -1847,7 +1847,9 @@ ACE_WFMO_Reactor_Notify::handle_signal (int signum, result = buffer->eh_->handle_exception (ACE_INVALID_HANDLE); break; default: - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("invalid mask = %d\n"), buffer->mask_)); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("invalid mask = %d\n"), + buffer->mask_)); break; } if (result == -1) diff --git a/apps/Gateway/Gateway/Gateway.cpp b/apps/Gateway/Gateway/Gateway.cpp index ec71e034228..1230220adbf 100644 --- a/apps/Gateway/Gateway/Gateway.cpp +++ b/apps/Gateway/Gateway/Gateway.cpp @@ -54,11 +54,8 @@ protected: int Gateway::handle_signal (int signum, siginfo_t *, ucontext_t *) { - if (signum > 0) - ACE_DEBUG ((LM_DEBUG, "(%t) %S\n", signum)); - // Shut down the main event loop. - ACE_Reactor::end_event_loop(); + ACE_Reactor::end_event_loop (); return 0; } diff --git a/apps/Gateway/Peer/Peer.cpp b/apps/Gateway/Peer/Peer.cpp index 429a4c24522..79ab12659b3 100644 --- a/apps/Gateway/Peer/Peer.cpp +++ b/apps/Gateway/Peer/Peer.cpp @@ -29,10 +29,16 @@ Peer_Handler::open (void *a) // Call down to the base class to activate and register this handler // with an <ACE_Reactor>. if (this->inherited::open (a) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "open"), + -1); if (this->peer ().enable (ACE_NONBLOCK) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "enable"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "enable"), + -1); ACE_Time_Value timeout (Options::instance ()->timeout ()); @@ -118,7 +124,8 @@ Peer_Handler::transmit_stdin (void) switch (n) { case 0: - ACE_DEBUG ((LM_DEBUG, "stdin closing down\n")); + ACE_DEBUG ((LM_DEBUG, + "stdin closing down\n")); // Take stdin out of the ACE_Reactor so we stop trying to // send events. @@ -130,7 +137,9 @@ Peer_Handler::transmit_stdin (void) /* NOTREACHED */ case -1: mb->release (); - ACE_ERROR ((LM_ERROR, "%p\n", "read")); + ACE_ERROR ((LM_ERROR, + "%p\n", + "read")); break; /* NOTREACHED */ default: @@ -140,7 +149,8 @@ Peer_Handler::transmit_stdin (void) return 0; } - ACE_DEBUG ((LM_DEBUG, "Must transmit over an opened channel.\n")); + ACE_DEBUG ((LM_DEBUG, + "Must transmit over an opened channel.\n")); return -1; } @@ -197,10 +207,12 @@ Peer_Handler::handle_output (ACE_HANDLE) { ACE_Message_Block *mb = 0; - ACE_DEBUG ((LM_DEBUG, "in handle_output\n")); + ACE_DEBUG ((LM_DEBUG, + "in handle_output\n")); if (this->msg_queue ()->dequeue_head - (mb, (ACE_Time_Value *) &ACE_Time_Value::zero) != -1) + (mb, + (ACE_Time_Value *) &ACE_Time_Value::zero) != -1) { switch (this->nonblk_put (mb)) { @@ -289,8 +301,10 @@ Peer_Handler::send (ACE_Message_Block *mb) errno = 0; } - ACE_DEBUG ((LM_DEBUG, "sent %d bytes, total bytes sent = %d\n", - n, this->total_bytes_)); + ACE_DEBUG ((LM_DEBUG, + "sent %d bytes, total bytes sent = %d\n", + n, + this->total_bytes_)); return n; } @@ -433,7 +447,9 @@ Peer_Handler::recv (ACE_Message_Block *&mb) int Peer_Handler::handle_input (ACE_HANDLE sd) { - ACE_DEBUG ((LM_DEBUG, "in handle_input, sd = %d\n", sd)); + ACE_DEBUG ((LM_DEBUG, + "in handle_input, sd = %d\n", + sd)); if (sd == ACE_STDIN) // Handle event from stdin. return this->transmit_stdin (); else @@ -483,11 +499,14 @@ Peer_Handler::await_connection_id (void) ACE_OS::rewind (stdin); // Register this handler to receive test events on stdin. - if (ACE_Event_Handler::register_stdin_handler (this, - ACE_Reactor::instance (), - ACE_Thread_Manager::instance ()) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", "register_stdin_handler"), -1); - + if (ACE_Event_Handler::register_stdin_handler + (this, + ACE_Reactor::instance (), + ACE_Thread_Manager::instance ()) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%t) %p\n", + "register_stdin_handler"), + -1); return 0; } @@ -578,10 +597,12 @@ Peer_Handler::handle_close (ACE_HANDLE, { if (this->get_handle () != ACE_INVALID_HANDLE) { - ACE_DEBUG ((LM_DEBUG, "shutting down Peer on handle %d\n", + ACE_DEBUG ((LM_DEBUG, + "shutting down Peer on handle %d\n", this->get_handle ())); - ACE_Reactor_Mask mask = ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::READ_MASK; + ACE_Reactor_Mask mask = + ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::READ_MASK; // Explicitly remove ourselves for ACE_STDIN (the <ACE_Reactor> // removes the HANDLE. Note that <ACE_Event_Handler::DONT_CALL> @@ -715,10 +736,6 @@ Peer_Connector::open (ACE_Reactor *, int) int Peer_Factory::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, - "signal %S occurred\n", - signum)); - if (signum != SIGPIPE) // Shut down the main event loop. ACE_Reactor::end_event_loop(); @@ -793,7 +810,10 @@ Peer_Factory::init (int argc, char *argv[]) if (ACE_Reactor::instance ()->register_handler (sig_set, this) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "register_handler"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); if (Options::instance ()->enabled (Options::SUPPLIER_ACCEPTOR) && this->consumer_acceptor_.open diff --git a/apps/JAWS/remora/app/test.cc b/apps/JAWS/remora/app/test.cc index 76158aac5a5..987c7bd07af 100644 --- a/apps/JAWS/remora/app/test.cc +++ b/apps/JAWS/remora/app/test.cc @@ -12,7 +12,7 @@ class Shutdown : public ACE_Event_Handler public: Shutdown(int& cond) : cond_(cond) {} - virtual int handle_signal(int, siginfo*, ucontext*) + virtual int handle_signal (int, siginfo*, ucontext*) { this->cond_ = 0; return 0; @@ -23,14 +23,13 @@ private: int& cond_; }; - int main(int argc, char** argv) { int lcv = 1; ACE_Sig_Handler shutdown; - shutdown.register_handler(SIGINT, new Shutdown(lcv)); + shutdown.register_handler (SIGINT, new Shutdown (lcv)); try { diff --git a/apps/Orbix-Examples/Event_Comm/Consumer/consumer.cpp b/apps/Orbix-Examples/Event_Comm/Consumer/consumer.cpp index 1c0b3c083ba..ef0ffe1be82 100644 --- a/apps/Orbix-Examples/Event_Comm/Consumer/consumer.cpp +++ b/apps/Orbix-Examples/Event_Comm/Consumer/consumer.cpp @@ -44,15 +44,11 @@ Consumer::handle_close (ACE_HANDLE, ACE_Reactor_Mask) int Consumer::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, - "%S\n", - signum)); - // Indicate that the consumer initiated the shutdown. this->ih_->consumer_initiated_shutdown (1); // Shut down the event loop. - ACE_Reactor::end_event_loop(); + ACE_Reactor::end_event_loop (); return 0; } diff --git a/apps/Orbix-Examples/Event_Comm/Supplier/supplier.cpp b/apps/Orbix-Examples/Event_Comm/Supplier/supplier.cpp index ecae0c45eb2..ef1e2c5d914 100644 --- a/apps/Orbix-Examples/Event_Comm/Supplier/supplier.cpp +++ b/apps/Orbix-Examples/Event_Comm/Supplier/supplier.cpp @@ -50,9 +50,6 @@ Supplier::handle_close (ACE_HANDLE, ACE_Reactor_Mask) int Supplier::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, - "%S\n", - signum)); ACE_Reactor::end_event_loop (); return 0; } diff --git a/examples/ASX/Event_Server/Transceiver/transceiver.cpp b/examples/ASX/Event_Server/Transceiver/transceiver.cpp index a53530d0942..abbd1b410a8 100644 --- a/examples/ASX/Event_Server/Transceiver/transceiver.cpp +++ b/examples/ASX/Event_Server/Transceiver/transceiver.cpp @@ -121,10 +121,6 @@ Event_Transceiver::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) received signal %S\n", - signum)); - ACE_Reactor::end_event_loop (); return 0; } diff --git a/examples/Connection/misc/Connection_Handler.cpp b/examples/Connection/misc/Connection_Handler.cpp index ebbbc0108a3..370a7a39451 100644 --- a/examples/Connection/misc/Connection_Handler.cpp +++ b/examples/Connection/misc/Connection_Handler.cpp @@ -191,9 +191,13 @@ Connection_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) { + // @@ Note that this code is not portable to all OS platforms since + // it uses print statements within signal handler context. + ACE_DEBUG ((LM_DEBUG, "received signal %S\n", signum)); + this->finished_ = 1; return 0; } diff --git a/examples/Connection/non_blocking/CPP-connector.cpp b/examples/Connection/non_blocking/CPP-connector.cpp index 7f7b3b36b9c..04f9dacc5ce 100644 --- a/examples/Connection/non_blocking/CPP-connector.cpp +++ b/examples/Connection/non_blocking/CPP-connector.cpp @@ -139,9 +139,12 @@ Peer_Handler<PR_ST_2>::handle_signal (int signum, siginfo_t *, ucontext_t *) { + ACE_UNUSED_ARG (signum); + + // @@ Note that this code is not portable to all OS platforms since + // it uses print statements within signal handler context. ACE_DEBUG ((LM_DEBUG, "in handle_signal\n")); - ACE_UNUSED_ARG (signum); return (this->*action_) (); } diff --git a/examples/Reactor/Misc/notification.cpp b/examples/Reactor/Misc/notification.cpp index dfa08bf72a8..e7850ebd371 100644 --- a/examples/Reactor/Misc/notification.cpp +++ b/examples/Reactor/Misc/notification.cpp @@ -199,7 +199,11 @@ Thread_Handler::svc (void) int Thread_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, "(%t) received signal %S\n", signum)); + // @@ Note that this code is not portable to all OS platforms since + // it uses print statements within signal handler context. + ACE_DEBUG ((LM_DEBUG, + "(%t) received signal %S\n", + signum)); switch (signum) { diff --git a/examples/Reactor/Misc/test_demuxing.cpp b/examples/Reactor/Misc/test_demuxing.cpp index 51602fb42d7..d0ae7c8c5a0 100644 --- a/examples/Reactor/Misc/test_demuxing.cpp +++ b/examples/Reactor/Misc/test_demuxing.cpp @@ -118,6 +118,8 @@ Sig_Handler::shutdown (ACE_HANDLE, ACE_Reactor_Mask) int Sig_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) { + // @@ Note that this code is not portable to all OS platforms since + // it uses print statements within signal handler context. ACE_DEBUG ((LM_DEBUG, "(%t) received signal %S\n", signum)); diff --git a/examples/Reactor/Misc/test_signals_1.cpp b/examples/Reactor/Misc/test_signals_1.cpp index 0f37d77a80a..f51fb6c9c4a 100644 --- a/examples/Reactor/Misc/test_signals_1.cpp +++ b/examples/Reactor/Misc/test_signals_1.cpp @@ -27,6 +27,8 @@ public: siginfo_t *, ucontext_t *) { + // @@ Note that this code is not portable to all OS platforms + // since it uses print statements within signal handler context. ACE_DEBUG ((LM_DEBUG, "Executed ACE signal handler for signal %S, count = %d\n", sig, diff --git a/examples/Reactor/Misc/test_signals_2.cpp b/examples/Reactor/Misc/test_signals_2.cpp index 9e1c1ce123f..f25c329bfe8 100644 --- a/examples/Reactor/Misc/test_signals_2.cpp +++ b/examples/Reactor/Misc/test_signals_2.cpp @@ -123,6 +123,8 @@ public: "register_handler")); } + // @@ Note that this code is not portable to all OS platforms since + // it does print statements within the signal handler. virtual int handle_signal (int signum, siginfo_t *, ucontext_t *) diff --git a/examples/Reactor/WFMO_Reactor/test_abandoned.cpp b/examples/Reactor/WFMO_Reactor/test_abandoned.cpp index e606b97219b..a787ea2c7c9 100644 --- a/examples/Reactor/WFMO_Reactor/test_abandoned.cpp +++ b/examples/Reactor/WFMO_Reactor/test_abandoned.cpp @@ -44,25 +44,17 @@ public: int Event_Handler::handle_signal (int signum, siginfo_t *s, ucontext_t *) { - char *reason = 0; - HANDLE handle = s->si_handle_; if (handle == this->handle_.handle ()) - { - reason = "event"; - ACE_ASSERT (ACE_Reactor::instance ()->register_handler (this, - this->mutex_->lock ().proc_mutex_) == 0); - } + ACE_Reactor::instance ()->register_handler (this, + this->mutex_->lock ().proc_mutex_); else { - ACE_ASSERT (ACE_Reactor::instance ()->remove_handler (this->mutex_->lock ().proc_mutex_, - ACE_Event_Handler::DONT_CALL) == 0); + ACE_Reactor::instance ()->remove_handler (this->mutex_->lock ().proc_mutex_, + ACE_Event_Handler::DONT_CALL); delete this->mutex_; - reason = "mutex"; } - ACE_DEBUG ((LM_DEBUG, "(%t) handle_signal for %s\n", reason)); - return 0; } diff --git a/examples/Reactor/WFMO_Reactor/test_apc.cpp b/examples/Reactor/WFMO_Reactor/test_apc.cpp index 4aa119cf284..b61137c3549 100644 --- a/examples/Reactor/WFMO_Reactor/test_apc.cpp +++ b/examples/Reactor/WFMO_Reactor/test_apc.cpp @@ -40,9 +40,7 @@ public: int Event_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, - "handling signal: %d iterations left\n", - --this->iterations_)); + --this->iterations_; if (this->iterations_ == 0) ACE_Reactor::end_event_loop (); diff --git a/examples/Reactor/WFMO_Reactor/test_directory_changes.cpp b/examples/Reactor/WFMO_Reactor/test_directory_changes.cpp index 3b4ada41d5d..763f5d492fb 100644 --- a/examples/Reactor/WFMO_Reactor/test_directory_changes.cpp +++ b/examples/Reactor/WFMO_Reactor/test_directory_changes.cpp @@ -65,7 +65,6 @@ Event_Handler::~Event_Handler (void) int Event_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, "(%t) Something changed in this directory\n")); ::FindNextChangeNotification (this->handle_); if (stop_test) this->reactor ()->close (); diff --git a/examples/Reactor/WFMO_Reactor/test_exceptions.cpp b/examples/Reactor/WFMO_Reactor/test_exceptions.cpp index fdec647d8b2..5ab6d00cb4e 100644 --- a/examples/Reactor/WFMO_Reactor/test_exceptions.cpp +++ b/examples/Reactor/WFMO_Reactor/test_exceptions.cpp @@ -30,21 +30,26 @@ ACE_RCSID(ReactorEx, test_exceptions, "$Id$") class Event_Handler : public ACE_Event_Handler { public: - Event_Handler () + Event_Handler (void) : event_ (1) { - ACE_DEBUG ((LM_DEBUG, "Event_Handler created\n")); + ACE_DEBUG ((LM_DEBUG, + "Event_Handler created\n")); } - ~Event_Handler () + + ~Event_Handler (void) { - ACE_DEBUG ((LM_DEBUG, "Event_Handler destroyed\n")); + 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 (); @@ -60,7 +65,8 @@ public: { for (int i = 1; i <= 10; i++) { - ACE_DEBUG ((LM_DEBUG, "Active threads in WFMO_Reactor (before handle_events) = %d\n", + ACE_DEBUG ((LM_DEBUG, + "Active threads in WFMO_Reactor (before handle_events) = %d\n", wfmo_reactor.active_threads_)); ACE_SEH_TRY { @@ -68,9 +74,11 @@ public: } ACE_SEH_EXCEPT (EXCEPTION_EXECUTE_HANDLER) { - ACE_DEBUG ((LM_DEBUG, "Exception occurred\n")); + ACE_DEBUG ((LM_DEBUG, + "Exception occurred\n")); } - ACE_DEBUG ((LM_DEBUG, "Active threads in WFMO_Reactor (after handle_events) = %d\n", + ACE_DEBUG ((LM_DEBUG, + "Active threads in WFMO_Reactor (after handle_events) = %d\n", wfmo_reactor.active_threads_)); } } @@ -82,7 +90,9 @@ main (int, char *[]) Event_Handler handler; ACE_WFMO_Reactor wfmo_reactor; wfmo_reactor.register_handler (&handler); + ACE_WFMO_Reactor_Test::doit (wfmo_reactor); + return 0; } diff --git a/examples/Reactor/WFMO_Reactor/test_multithreading.cpp b/examples/Reactor/WFMO_Reactor/test_multithreading.cpp index e4fa15f24e9..54240684bd3 100644 --- a/examples/Reactor/WFMO_Reactor/test_multithreading.cpp +++ b/examples/Reactor/WFMO_Reactor/test_multithreading.cpp @@ -151,22 +151,22 @@ Task_Handler::handle_signal (int signum, siginfo_t *siginfo, ucontext_t *) { // When signaled, print message, remove self, and add self // This will force Reactor to update its internal handle tables - ACE_DEBUG ((LM_DEBUG, "(%t) handle_signal() called: handle value = %d\n", - siginfo->si_handle_)); if (ACE_Reactor::instance ()->remove_handler (siginfo->si_handle_, ACE_Event_Handler::DONT_CALL) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "(%t) %p\tTask cannot be unregistered from Reactor: handle value = %d\n", - "Task_Handler::handle_signal", - siginfo->si_handle_), -1); + return -1; + // ACE_ERROR_RETURN ((LM_ERROR, + // "(%t) %p\tTask cannot be unregistered from Reactor: handle value = %d\n", + // "Task_Handler::handle_signal", + // siginfo->si_handle_), -1); if (ACE_Reactor::instance ()->register_handler (this, siginfo->si_handle_) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "(%t) %p\tTask cannot be registered with Reactor: handle value = %d\n", - "Task_Handler::handle_signal", - siginfo->si_handle_), -1); + return -1; + // ACE_ERROR_RETURN ((LM_ERROR, + // "(%t) %p\tTask cannot be registered with Reactor: handle value = %d\n", + // "Task_Handler::handle_signal", + // siginfo->si_handle_), -1); return 0; } diff --git a/examples/Reactor/WFMO_Reactor/test_registration.cpp b/examples/Reactor/WFMO_Reactor/test_registration.cpp index 9bebc0a7a22..cd34d60609a 100644 --- a/examples/Reactor/WFMO_Reactor/test_registration.cpp +++ b/examples/Reactor/WFMO_Reactor/test_registration.cpp @@ -68,27 +68,22 @@ int Simple_Handler::handle_signal (int signum, siginfo_t *s, ucontext_t *) { ACE_HANDLE handle = s->si_handle_; - ACE_DEBUG ((LM_DEBUG, "Simple_Handler::handle_signal handle = %d\n", handle)); + this->handle_signal_count_++; if (this->handle_signal_count_ == 1) - { - ACE_DEBUG ((LM_DEBUG, "suspending handle = %d\n", event1_.handle ())); - this->reactor ()->suspend_handler (event1_.handle ()); - } + this->reactor ()->suspend_handler (event1_.handle ()); else if (this->handle_signal_count_ == 2) { - ACE_DEBUG ((LM_DEBUG, "resuming handle = %d\n", event1_.handle ())); this->reactor ()->resume_handler (event1_.handle ()); - ACE_DEBUG ((LM_DEBUG, "suspending handle = %d\n", event2_.handle ())); this->reactor ()->suspend_handler (event2_.handle ()); } else if (this->handle_signal_count_ == 3) { - ACE_DEBUG ((LM_DEBUG, "removing handle = %d\n", event1_.handle ())); - this->reactor ()->remove_handler (event1_.handle (), ACE_Event_Handler::NULL_MASK); - ACE_DEBUG ((LM_DEBUG, "removing handle = %d\n", event2_.handle ())); - this->reactor ()->remove_handler (event2_.handle (), ACE_Event_Handler::NULL_MASK); + this->reactor ()->remove_handler (event1_.handle (), + ACE_Event_Handler::NULL_MASK); + this->reactor ()->remove_handler (event2_.handle (), + ACE_Event_Handler::NULL_MASK); } return 0; } diff --git a/examples/Reactor/WFMO_Reactor/test_registry_changes.cpp b/examples/Reactor/WFMO_Reactor/test_registry_changes.cpp index 37b466dc40b..9b0fc9f5930 100644 --- a/examples/Reactor/WFMO_Reactor/test_registry_changes.cpp +++ b/examples/Reactor/WFMO_Reactor/test_registry_changes.cpp @@ -67,8 +67,6 @@ Event_Handler::~Event_Handler (void) int Event_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, "(%t) Something changed in the Registry\n")); - if (stop_test) this->reactor ()->close (); else if (::RegNotifyChangeKeyValue (this->context_.key (), // handle of key to watch @@ -77,8 +75,8 @@ Event_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) this->event_.handle (), // handle of signaled event TRUE // flag for asynchronous reporting ) != ERROR_SUCCESS) - ACE_ERROR ((LM_ERROR, "RegNotifyChangeKeyValue could not be setup\n")); - + ACE_ERROR ((LM_ERROR, + "RegNotifyChangeKeyValue could not be setup\n")); return 0; } diff --git a/examples/Reactor/WFMO_Reactor/test_removals.cpp b/examples/Reactor/WFMO_Reactor/test_removals.cpp index 00701e4c9d4..9613b6748de 100644 --- a/examples/Reactor/WFMO_Reactor/test_removals.cpp +++ b/examples/Reactor/WFMO_Reactor/test_removals.cpp @@ -49,8 +49,6 @@ public: virtual int handle_signal (int index, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, "event %d occured.\n", event_number_)); - if (this->close_down_) return -1; else diff --git a/examples/Reactor/WFMO_Reactor/test_talker.cpp b/examples/Reactor/WFMO_Reactor/test_talker.cpp index fa0c8e4140f..f9a0c2b8a4e 100644 --- a/examples/Reactor/WFMO_Reactor/test_talker.cpp +++ b/examples/Reactor/WFMO_Reactor/test_talker.cpp @@ -503,9 +503,8 @@ STDIN_Handler::register_thread_exit_hook (void) int STDIN_Handler::handle_signal (int, siginfo_t *si, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, "(%t) STDIN thread has exited.\n")); ACE_ASSERT (this->thr_handle_ == si->si_handle_); - ACE_Reactor::end_event_loop(); + ACE_Reactor::end_event_loop (); return 0; } diff --git a/examples/Reactor/WFMO_Reactor/test_window_messages.cpp b/examples/Reactor/WFMO_Reactor/test_window_messages.cpp index 3928a4fea34..d63730b84ab 100644 --- a/examples/Reactor/WFMO_Reactor/test_window_messages.cpp +++ b/examples/Reactor/WFMO_Reactor/test_window_messages.cpp @@ -36,9 +36,7 @@ public: int Event_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) { - ACE_DEBUG ((LM_DEBUG, - "handling signal: %d iterations left\n", - --this->iterations_)); + --this->iterations_; if (this->iterations_ == 0) ACE_Reactor::end_event_loop (); diff --git a/netsvcs/lib/Client_Logging_Handler.cpp b/netsvcs/lib/Client_Logging_Handler.cpp index e81cbf8a383..2376619aaf2 100644 --- a/netsvcs/lib/Client_Logging_Handler.cpp +++ b/netsvcs/lib/Client_Logging_Handler.cpp @@ -28,7 +28,6 @@ ACE_Client_Logging_Handler::ACE_Client_Logging_Handler (ACE_HANDLE output_handle int ACE_Client_Logging_Handler::handle_signal (int, siginfo_t *, ucontext_t *) { - ACE_TRACE ("ACE_Client_Logging_Acceptor::handle_signal"); return -1; } diff --git a/netsvcs/lib/TS_Clerk_Handler.cpp b/netsvcs/lib/TS_Clerk_Handler.cpp index 6a86abfbfce..59ffc9470cb 100644 --- a/netsvcs/lib/TS_Clerk_Handler.cpp +++ b/netsvcs/lib/TS_Clerk_Handler.cpp @@ -68,7 +68,6 @@ ACE_TS_Clerk_Handler::timeout (void) int ACE_TS_Clerk_Handler::handle_signal (int, siginfo_t *, ucontext_t *) { - ACE_TRACE ("ACE_TS_Clerk_Handler::handle_signal"); return -1; } |