diff options
author | Steve Huston <shuston@riverace.com> | 2008-10-06 22:32:10 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2008-10-06 22:32:10 +0000 |
commit | 23e85dd79dd7a784abbec828620182301d3b076c (patch) | |
tree | 7b1d2e96fb1d38ff093ed3450dc0cc85b3c0c39e | |
parent | a8f7cd8a16d54b568e9ec269919ef872ad0f67f4 (diff) | |
download | ATCD-23e85dd79dd7a784abbec828620182301d3b076c.tar.gz |
ChangeLogTag:Mon Oct 6 22:27:54 UTC 2008 Steve Huston <shuston@riverace.com>
-rw-r--r-- | ACE/ChangeLog | 11 | ||||
-rw-r--r-- | ACE/ace/WFMO_Reactor.inl | 4 | ||||
-rw-r--r-- | ACE/tests/Reactor_Dispatch_Order_Test.cpp | 27 |
3 files changed, 37 insertions, 5 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 5fac86b2383..b031a0f289d 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,14 @@ +Mon Oct 6 22:27:54 UTC 2008 Steve Huston <shuston@riverace.com> + + * ace/WFMO_Reactor.inl (suBspend_handlers): Never suspend the notify + or the wakeup_all_threBBads handles - these are specially set up by + ACE_WFMO_Reactor::open(), not by users, and are critical to the + proper functioning of the event loop. + Fixes Bugzilla #3267.b + + * tests/Reactor_Dispatch_Order_Test.cpp: Added some additional + sanity checks and fixed some logging. + Fri Oct 3 19:05:39 UTC 2008 Yan Dai <dai_y@ociweb.com> * ace/Reactor_Token_T.cpp: diff --git a/ACE/ace/WFMO_Reactor.inl b/ACE/ace/WFMO_Reactor.inl index 8a97a6526ed..2e302b8c6c2 100644 --- a/ACE/ace/WFMO_Reactor.inl +++ b/ACE/ace/WFMO_Reactor.inl @@ -735,7 +735,9 @@ ACE_WFMO_Reactor::suspend_handlers (void) // First suspend all current handles bool changes_required = false; - for (size_t i = 0; + // Skip over the notify and wakeup_all_threads handles. These are registered + // by ACE_WFMO_Reactor::open(), not by users, and should not be suspended. + for (size_t i = 2; i < this->handler_rep_.max_handlep1_ && !error; i++) { diff --git a/ACE/tests/Reactor_Dispatch_Order_Test.cpp b/ACE/tests/Reactor_Dispatch_Order_Test.cpp index 08299c20094..8c5e63e565c 100644 --- a/ACE/tests/Reactor_Dispatch_Order_Test.cpp +++ b/ACE/tests/Reactor_Dispatch_Order_Test.cpp @@ -200,12 +200,19 @@ test_reactor_dispatch_order (ACE_Reactor &reactor) // Suspend the handlers - only the timer should be dispatched ACE_Time_Value tv (1); reactor.suspend_handlers (); - reactor.run_reactor_event_loop (tv); + if (0 != reactor.run_reactor_event_loop (tv)) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("run_reactor_event_loop"))); + ok_to_go = false; + } // only the timer should have fired if (handler.dispatch_order_ != 2) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Incorrect number fired %d\n"), + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Incorrect number fired %d; expected 2\n"), handler.dispatch_order_)); ok_to_go = false; } @@ -225,7 +232,13 @@ test_reactor_dispatch_order (ACE_Reactor &reactor) if (ok_to_go) { - reactor.run_reactor_event_loop (tv); + if (0 != reactor.run_reactor_event_loop (tv)) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("run_reactor_event_loop 2"))); + ok_to_go = false; + } } if (0 != reactor.remove_handler (handler.pipe_.read_handle (), @@ -237,11 +250,17 @@ test_reactor_dispatch_order (ACE_Reactor &reactor) if (handler.dispatch_order_ != 4) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Incorrect number fired %d\n"), + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Incorrect number fired %d; expected 4\n"), handler.dispatch_order_)); ok_to_go = false; } + int nr_cancelled = reactor.cancel_timer (&handler); + if (nr_cancelled > 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Finishing test with %d timers still scheduled\n"), + nr_cancelled)); return ok_to_go; } |