diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-20 01:07:21 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-20 01:07:21 +0000 |
commit | 845d4dd067bfa93b91ef7500147441c5bc88e273 (patch) | |
tree | f3e46a43474909cf56268858eb1a6a0687e715b4 | |
parent | 23b12ae2fb740a0029899357497629a105cef550 (diff) | |
download | ATCD-845d4dd067bfa93b91ef7500147441c5bc88e273.tar.gz |
ChangeLogTag: Mon Mar 19 16:57:43 2001 Irfan Pyarali <irfan@cs.wustl.edu>
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 17 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 17 | ||||
-rw-r--r-- | ace/TP_Reactor.cpp | 2 | ||||
-rw-r--r-- | tests/Thread_Pool_Reactor_Test.cpp | 33 |
5 files changed, 72 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog index 5e98d83d8d9..16656ecc1d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +Mon Mar 19 16:57:43 2001 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/TP_Reactor.cpp (handle_events): Return value from + handle_events() after the Reactor has been deactivated should be + -1. We just need to remember that as illustrated in + ACE_Reactor::run_reactor_event_loop(), this is not an error: + + if (result == -1 && this->implementation_->deactivated ()) + return 0; + + * tests/Thread_Pool_Reactor_Test.cpp (svr_worker): Changed this + function to call ACE_Reactor::run_reactor_event_loop() instead + of ACE_Reactor::handle_events(). In the previous revision, we + were not handling return values from + ACE_Reactor::handle_events() correctly when + ACE_Reactor::deactivated() had been called. + Mon Mar 19 09:14:12 2001 Chad Elliott <elliott_c@ociweb.com> * include/makeinclude/platform_chorus4.x_g++.GNU: diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 5e98d83d8d9..16656ecc1d2 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,20 @@ +Mon Mar 19 16:57:43 2001 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/TP_Reactor.cpp (handle_events): Return value from + handle_events() after the Reactor has been deactivated should be + -1. We just need to remember that as illustrated in + ACE_Reactor::run_reactor_event_loop(), this is not an error: + + if (result == -1 && this->implementation_->deactivated ()) + return 0; + + * tests/Thread_Pool_Reactor_Test.cpp (svr_worker): Changed this + function to call ACE_Reactor::run_reactor_event_loop() instead + of ACE_Reactor::handle_events(). In the previous revision, we + were not handling return values from + ACE_Reactor::handle_events() correctly when + ACE_Reactor::deactivated() had been called. + Mon Mar 19 09:14:12 2001 Chad Elliott <elliott_c@ociweb.com> * include/makeinclude/platform_chorus4.x_g++.GNU: diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 5e98d83d8d9..16656ecc1d2 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,20 @@ +Mon Mar 19 16:57:43 2001 Irfan Pyarali <irfan@cs.wustl.edu> + + * ace/TP_Reactor.cpp (handle_events): Return value from + handle_events() after the Reactor has been deactivated should be + -1. We just need to remember that as illustrated in + ACE_Reactor::run_reactor_event_loop(), this is not an error: + + if (result == -1 && this->implementation_->deactivated ()) + return 0; + + * tests/Thread_Pool_Reactor_Test.cpp (svr_worker): Changed this + function to call ACE_Reactor::run_reactor_event_loop() instead + of ACE_Reactor::handle_events(). In the previous revision, we + were not handling return values from + ACE_Reactor::handle_events() correctly when + ACE_Reactor::deactivated() had been called. + Mon Mar 19 09:14:12 2001 Chad Elliott <elliott_c@ociweb.com> * include/makeinclude/platform_chorus4.x_g++.GNU: diff --git a/ace/TP_Reactor.cpp b/ace/TP_Reactor.cpp index 300a0d1c135..f0eb9fe9c2f 100644 --- a/ace/TP_Reactor.cpp +++ b/ace/TP_Reactor.cpp @@ -102,7 +102,7 @@ ACE_TP_Reactor::handle_events (ACE_Time_Value *max_wait_time) if (this->deactivated_) { ACE_MT (this->token_.release ()); - return 0; + return -1; } // We got the lock, lets handle some events. Note: this method will diff --git a/tests/Thread_Pool_Reactor_Test.cpp b/tests/Thread_Pool_Reactor_Test.cpp index b072a8f1c04..4c57055c0f4 100644 --- a/tests/Thread_Pool_Reactor_Test.cpp +++ b/tests/Thread_Pool_Reactor_Test.cpp @@ -137,7 +137,7 @@ Request_Handler::handle_input (ACE_HANDLE fd) ssize_t result = this->peer ().recv (&len, sizeof (ACE_TCHAR)); if (result > 0 - && this->peer ().recv_n (buffer, len * sizeof (ACE_TCHAR)) + && this->peer ().recv_n (buffer, len * sizeof (ACE_TCHAR)) == ACE_static_cast (ssize_t, len * sizeof (ACE_TCHAR))) { ++this->nr_msgs_rcvd_; @@ -168,30 +168,37 @@ Request_Handler::handle_close (ACE_HANDLE fd, ACE_Reactor_Mask) ACE_ERROR((LM_ERROR, "(%t) Handler 0x%x: Expected %d messages; got %d\n", this, - cli_req_no, + cli_req_no, this->nr_msgs_rcvd_)); this->destroy (); return 0; } +static int +reactor_event_hook (void *) +{ + ACE_DEBUG ((LM_DEBUG, + "(%t) handling events ....\n")); + + return 0; +} + static void * svr_worker (void *) { // Server thread function. + int result = + ACE_Reactor::instance ()->run_reactor_event_loop (&reactor_event_hook); - while (!ACE_Reactor::event_loop_done ()) - { - ACE_DEBUG ((LM_DEBUG, - "(%t) handling events ....\n")); - - if (ACE_Reactor::instance ()->handle_events () == -1) - ACE_ERROR ((LM_ERROR, - "(%t) %p\n", - "Error handling events")); - } + if (result == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%t) %p\n", + "Error handling events"), + 0); ACE_DEBUG ((LM_DEBUG, "(%t) I am done handling events. Bye, bye\n")); + return 0; } @@ -342,7 +349,7 @@ main (int, ACE_TCHAR *[]) { ACE_START_TEST (ACE_TEXT ("Thread_Pool_Reactor_Test")); - ACE_ERROR ((LM_INFO, + ACE_ERROR ((LM_INFO, "threads not supported on this platform\n")); ACE_END_TEST; |