diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-11-28 08:48:27 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-11-28 08:48:27 +0000 |
commit | f6bff3e8715e84536bf5f4297c054df3a2ee57ac (patch) | |
tree | 8105cb9cb974aaeadb6a40199ab425826f42dad0 | |
parent | 93ec4ea59eb36bf65f0f1103b39e7a914ca2ef15 (diff) | |
download | ATCD-f6bff3e8715e84536bf5f4297c054df3a2ee57ac.tar.gz |
CangeLogTag:Sun Nov 28 02:41:02 1999 Nanbor Wang <nanbor@cs.wustl.edu>
-rw-r--r-- | ChangeLog-99b | 15 | ||||
-rw-r--r-- | tests/Reactor_Notify_Test.cpp | 19 |
2 files changed, 25 insertions, 9 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index 0431f9a78be..f53cc1a0ca3 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,3 +1,18 @@ +Sun Nov 28 02:41:02 1999 Nanbor Wang <nanbor@cs.wustl.edu> + + * tests/Reactor_Notify_Test.cpp (run_test): Only print out the + error message when the notification pipe is not disable. + Otherwise, when the notification pipe gets disabled, the event + loop depends purely on the OS scheduling policy to determine how + many times to gets to run. Since the Supplier_Task removes + itself from the reactor, there could be no active event handler + available in the reactor when the <handle_events> gets called if + the <perform_notifications> task finishes before the event loop + has a chance to finish its iterations. Another way to solve + this is to add a thr_yield after every notification but that + seems to defeat the intension of the test. Thanks to Ivan + Murphy for reporting the false error output. + Sat Nov 27 22:06:26 1999 Nanbor Wang <nanbor@cs.wustl.edu> * ace/OS.cpp: Defined ACE_ENDTHREADEX and ACE_BEGINTHREADEX to use diff --git a/tests/Reactor_Notify_Test.cpp b/tests/Reactor_Notify_Test.cpp index 9d8ce4b0be0..1db35ba60bb 100644 --- a/tests/Reactor_Notify_Test.cpp +++ b/tests/Reactor_Notify_Test.cpp @@ -140,7 +140,7 @@ Supplier_Task::close (u_long) { ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) Supplier_Task::close\n"))); - + int result; if (long_timeout_ == 0) @@ -186,13 +186,13 @@ Supplier_Task::perform_notifications (int notifications) i)); int result; - + // Notify the Reactor, which will call <handle_exception>. result = ACE_Reactor::instance ()->notify (this); if (result == -1) { if (errno == ETIME) - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) %p\n"), ASYS_TEXT ("notify"))); else @@ -229,7 +229,7 @@ Supplier_Task::svc (void) // Only allow 1 iteration per <ACE_Reactor::notify> this->perform_notifications (1); - + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) **** exiting thread test\n"))); } @@ -298,7 +298,7 @@ run_test (int disable_notify_pipe, ACE_ASSERT (ACE_LOG_MSG->op_status () != -1); int result; - + result = task.open (); ACE_ASSERT (result != -1); @@ -327,9 +327,10 @@ run_test (int disable_notify_pipe, switch (ACE_Reactor::instance ()->handle_events (timeout)) { case -1: - ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("(%t) %p\n"), - ASYS_TEXT ("reactor"))); + if (! disable_notify_pipe) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("(%t) %p\n"), + ASYS_TEXT ("reactor"))); shutdown = 1; break; /* NOTREACHED */ @@ -371,7 +372,7 @@ main (int, ASYS_TCHAR *[]) run_test (0, timeout); ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("(%t) running tests with notify pipe diabled") + ASYS_TEXT ("(%t) running tests with notify pipe disabled") ASYS_TEXT (" and time-out = %d seconds\n"), timeout.sec ())); run_test (1, timeout); |