summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-30 01:36:13 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-30 01:36:13 +0000
commitd833c6d9baa65caba564ae60bbb723a255ed0d97 (patch)
tree1eec66cbda02baddbf05942ed7042a9a23e49cfa
parent6ca5cfeb3f67ccf4dd07f5434c8b722f26b54e05 (diff)
downloadATCD-d833c6d9baa65caba564ae60bbb723a255ed0d97.tar.gz
*** empty log message ***
-rw-r--r--ChangeLog-98b7
-rw-r--r--tests/Thread_Pool_Reactor_Test.cpp29
2 files changed, 8 insertions, 28 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b
index cd7cbdb8845..6ad483183a6 100644
--- a/ChangeLog-98b
+++ b/ChangeLog-98b
@@ -1,5 +1,12 @@
Sun Nov 29 18:22:52 1998 Nanbor Wang <nanbor@cs.wustl.edu>
+ * tests/Thread_Pool_Reactor_Test.cpp: Removed the use of
+ "main_reactor". The "main_reactor" was added to handle incoming
+ connections because this test was not working correctly without
+ moving out the acceptor to another reactor. However, I recently
+ found that the problem was actually due to the deadlocked
+ notify_handler which I fixed a while back.
+
* ace/OS.h: Added forward declarations of ACE_Time_Value's
operator{+,-} so VC 6.0 won't get confused with the
operator{+,-} in namespace std. Thanks to Victor Yu
diff --git a/tests/Thread_Pool_Reactor_Test.cpp b/tests/Thread_Pool_Reactor_Test.cpp
index 50bab02466f..4d8770bcc96 100644
--- a/tests/Thread_Pool_Reactor_Test.cpp
+++ b/tests/Thread_Pool_Reactor_Test.cpp
@@ -85,14 +85,6 @@ static size_t cli_req_no = ACE_MAX_THREADS ACE_LOAD_FACTOR;
static int req_delay = 50;
// Delay before a thread sending the next request (in msec.)
-static int main_event_loop = 1;
-// ACE_Reactor::end_event_loop() terminates only the singleton reactor,
-// therefore, we need another flag to terminate the reactor in main ()
-// (which accepts new connection.)
-
-static ACE_Reactor *main_reactor = 0;
-// Reactor used to accept new connection request.
-
void
parse_arg (int argc, ASYS_TCHAR *argv[])
{
@@ -161,11 +153,7 @@ Request_Handler::handle_input (ACE_HANDLE fd)
buffer));
if (ACE_OS::strcmp (buffer,
ASYS_TEXT ("shutdown")) == 0)
- {
- main_event_loop = 0;
- main_reactor->notify ();
ACE_Reactor::end_event_loop ();
- }
return 0;
}
else
@@ -312,18 +300,10 @@ main (int argc, ASYS_TCHAR *argv[])
ACE_Reactor new_reactor (&sr);
ACE_Reactor::instance (&new_reactor);
- // Most platforms seem to have trouble accepting connections
- // simultaneously in multiple threads. Therefore, we can't quite
- // use the <Acceptor> with the <TP_Reactor>. Create a
- // <Select_Reactor> and run the event_loop in the main thread.
- ACE_Select_Reactor slr;
- ACE_Reactor mreactor (&slr);
- main_reactor = &mreactor;
ACCEPTOR acceptor;
ACE_INET_Addr accept_addr (rendezvous);
- if (acceptor.open (accept_addr,
- main_reactor) == -1)
+ if (acceptor.open (accept_addr) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ASYS_TEXT ("%p\n"),
ASYS_TEXT ("open")),
@@ -336,13 +316,6 @@ main (int argc, ASYS_TCHAR *argv[])
svr_worker);
ACE_Thread_Manager::instance ()->spawn (worker);
- while (main_event_loop)
- {
- int result = slr.handle_events ();
-
- ACE_ASSERT (result != -1);
- }
-
ACE_Thread_Manager::instance ()->wait ();
ACE_END_TEST;