summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2012-10-10 22:50:29 +0000
committerSteve Huston <shuston@riverace.com>2012-10-10 22:50:29 +0000
commit2d886866539d5b1e5b485e19a0d2ec967796c89b (patch)
treeb03a4168cfdc47836c86bb481a949c007725c639
parente67df0cd2ec3b7e51b759f5d5bb05378ce0fc362 (diff)
downloadATCD-2d886866539d5b1e5b485e19a0d2ec967796c89b.tar.gz
ChangeLogTag:Wed Oct 10 22:45:23 UTC 2012 Steve Huston <shuston@riverace.com>
-rw-r--r--ACE/ChangeLog9
-rw-r--r--ACE/ace/Reactor.h15
-rw-r--r--ACE/tests/Network_Adapters_Test.cpp11
-rw-r--r--ACE/tests/Network_Adapters_Test.h2
4 files changed, 24 insertions, 13 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 0fe67d009dd..0eac5bd32ee 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,12 @@
+Wed Oct 10 22:45:23 UTC 2012 Steve Huston <shuston@riverace.com>
+
+ * ace/Reactor.h: Corrected the comments concerning removal of
+ signal handler registrations - they DO call handle_close() now.
+
+ * tests/Network_Adapters_Test.{cpp, h}: Corrected the call to remove
+ signal handlers and added a check in Stop_Handler::handle_close()
+ to ignore calls as a result of removing a signal handler.
+
Wed Oct 10 18:47:12 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
* docs/bczar/bczar.html:
diff --git a/ACE/ace/Reactor.h b/ACE/ace/Reactor.h
index de3991f2800..23d973c0c68 100644
--- a/ACE/ace/Reactor.h
+++ b/ACE/ace/Reactor.h
@@ -462,15 +462,12 @@ public:
* Install the new disposition (if given) and return the previous
* disposition (if desired by the caller).
*
- * Note that, unlike removing handler for I/O events,
- * ACE_Event_Handler::handle_close() will not be called when the
- * handler is removed. Neither will any reference-counting activity be
- * involved.
- *
- * @note There's an existing enhancement request in Bugzilla,
- * #2368, to change this behavior so that ACE_Event_Handler::handle_close()
- * is called when the signal handler is removed. Thus, there's some chance
- * this behavior will change in a future version of ACE.
+ * Note that the registered handler's ACE_Event_Handler::handle_close ()
+ * callback will be called to indicate the signal handler has been removed.
+ * Unlike with I/O handles, there is no way to prevent this callback. The
+ * handle_close() callback can check the passed mask for the value
+ * ACE_Event_Handler::SIGNAL_MASK to tell when the callback is the result
+ * of a signal handler removal.
*/
int remove_handler (int signum,
ACE_Sig_Action *new_disp,
diff --git a/ACE/tests/Network_Adapters_Test.cpp b/ACE/tests/Network_Adapters_Test.cpp
index 90c2fdb87af..369a1c9d7a6 100644
--- a/ACE/tests/Network_Adapters_Test.cpp
+++ b/ACE/tests/Network_Adapters_Test.cpp
@@ -563,6 +563,7 @@ Stop_Handler::open (void)
ACE_TEXT ("(%P|%t) Stop_Handler::open: %p <%d>\n"),
ACE_TEXT ("register_handler for SIGINT"), SIGINT),
-1);
+ this->registered_signals_.sig_add (SIGINT);
#endif /* SIGINT != 0 */
#if (SIGTERM != 0)
@@ -571,6 +572,7 @@ Stop_Handler::open (void)
ACE_TEXT ("(%P|%t) Stop_Handler::open: %p <%d>\n"),
ACE_TEXT ("register_handler for SIGTERM"), SIGTERM),
-1);
+ this->registered_signals_.sig_add (SIGTERM);
#endif /* SIGTERM != 0 */
#if (SIGQUIT != 0)
@@ -579,6 +581,7 @@ Stop_Handler::open (void)
ACE_TEXT ("(%P|%t) Stop_Handler::open: %p <%d>\n"),
ACE_TEXT ("register_handler for SIGQUIT"), SIGQUIT),
-1);
+ this->registered_signals_.sig_add (SIGQUIT);
#endif /* SIGQUIT != 0 */
return 0;
}
@@ -641,9 +644,7 @@ Stop_Handler::handle_input (ACE_HANDLE handle)
}
}
- this->reactor ()->remove_handler (this,
- ACE_Event_Handler::SIGNAL_MASK |
- ACE_Event_Handler::DONT_CALL);
+ this->reactor ()->remove_handler (this->registered_signals_);
if (reactor ()->end_reactor_event_loop () == -1)
{
@@ -659,10 +660,12 @@ Stop_Handler::handle_input (ACE_HANDLE handle)
}
int
-Stop_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
+Stop_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask m)
{
ACE_DEBUG ((LM_INFO,
ACE_TEXT ("(%P|%t) Stop_Handler::handle_close - entered.\n")));
+ if (m == ACE_Event_Handler::SIGNAL_MASK)
+ return 0;
this->reactor ()->remove_handler (this,
ACE_Event_Handler::SIGNAL_MASK |
ACE_Event_Handler::DONT_CALL);
diff --git a/ACE/tests/Network_Adapters_Test.h b/ACE/tests/Network_Adapters_Test.h
index f5c8e9121ed..6cfeb9d02d2 100644
--- a/ACE/tests/Network_Adapters_Test.h
+++ b/ACE/tests/Network_Adapters_Test.h
@@ -214,6 +214,8 @@ private:
// Table to place here pointers to all tasks in the process.
ACE_Event_Handler * handlers_to_stop_[HANDLERS_TO_STOP_TABLE_SIZE];
+
+ ACE_Sig_Set registered_signals_;
};