summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-04-13 17:11:47 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-04-13 17:11:47 +0000
commit4b62b2711f6b2132099aa6a46a1e86eb68c9e87d (patch)
tree7fffbae2b820d5b7f24217b1076318c7802abd0b
parent7afaab86b0a559fb6ede93d3038a8cd50bf178e8 (diff)
downloadATCD-4b62b2711f6b2132099aa6a46a1e86eb68c9e87d.tar.gz
ChangeLogTag:Fri Apr 13 12:05:38 2001 Nanbor Wang <nanbor@cs.wustl.edu>
-rw-r--r--ChangeLog20
-rw-r--r--ChangeLogs/ChangeLog-02a20
-rw-r--r--ChangeLogs/ChangeLog-03a20
-rw-r--r--tests/MEM_Stream_Test.cpp35
-rw-r--r--tests/MEM_Stream_Test.h7
5 files changed, 63 insertions, 39 deletions
diff --git a/ChangeLog b/ChangeLog
index 163db36a03b..b5712152655 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,17 @@
+Fri Apr 13 12:05:38 2001 Nanbor Wang <nanbor@cs.wustl.edu>
+
+ * tests/MEM_Stream_Test.cpp: Borland C++ has problem cleaning up
+ the static Atomic_Op object in Echo_Handler in the right order.
+ Made that an ACE_Singleton and re-organized the test a big.
+ Thanks to Chris Kohlhoff <chris@kohlhoff.com> for reporting and
+ suggesting the fix. [Bug 862]
+
Fri Apr 13 05:30:04 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* ace/Malloc_T.{h,i}: Added support for one of the calloc() methods
to ACE_Cached_Allocator. Thanks to Rachel G Smith
<Rachel_G_Smith@raytheon.com> for motivating this change.
-
+
* ace/Malloc_Allocator.h: Updated the comments for ACE_New_Allocator
to indicate that the calloc() methods are also supported.
Thanks to Rachel G Smith <Rachel_G_Smith@raytheon.com> for
@@ -57,17 +65,17 @@ Thu Apr 12 13:06:27 2001 Joel Sherrill <joel@OARcorp.com>
* include/makeinclude/Makefile.rtems: Replaced debug version
with real version that queries RTEMS application Makefile
infrastructure.
-
- * include/makeinclude/platform_rtems.x_g++.GNU: Added
+
+ * include/makeinclude/platform_rtems.x_g++.GNU: Added
--no-print-directory option to all invocations of recursive
make to determine information from Makefile.rtems. This
avoids getting the "entering/exiting directory" messages
included in the results.
-
- * ACE-RTEMS.README: Added requirement to configure C++
+
+ * ACE-RTEMS.README: Added requirement to configure C++
support in RTEMS. Updated to reflect also compiling for mc68360
target.
-
+
Wed Apr 11 20:36:36 2001 Nanbor Wang <nanbor@cs.wustl.edu>
* examples/Synch/proc_sema.cpp (main): Fixd an assigning string
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 163db36a03b..b5712152655 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,9 +1,17 @@
+Fri Apr 13 12:05:38 2001 Nanbor Wang <nanbor@cs.wustl.edu>
+
+ * tests/MEM_Stream_Test.cpp: Borland C++ has problem cleaning up
+ the static Atomic_Op object in Echo_Handler in the right order.
+ Made that an ACE_Singleton and re-organized the test a big.
+ Thanks to Chris Kohlhoff <chris@kohlhoff.com> for reporting and
+ suggesting the fix. [Bug 862]
+
Fri Apr 13 05:30:04 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* ace/Malloc_T.{h,i}: Added support for one of the calloc() methods
to ACE_Cached_Allocator. Thanks to Rachel G Smith
<Rachel_G_Smith@raytheon.com> for motivating this change.
-
+
* ace/Malloc_Allocator.h: Updated the comments for ACE_New_Allocator
to indicate that the calloc() methods are also supported.
Thanks to Rachel G Smith <Rachel_G_Smith@raytheon.com> for
@@ -57,17 +65,17 @@ Thu Apr 12 13:06:27 2001 Joel Sherrill <joel@OARcorp.com>
* include/makeinclude/Makefile.rtems: Replaced debug version
with real version that queries RTEMS application Makefile
infrastructure.
-
- * include/makeinclude/platform_rtems.x_g++.GNU: Added
+
+ * include/makeinclude/platform_rtems.x_g++.GNU: Added
--no-print-directory option to all invocations of recursive
make to determine information from Makefile.rtems. This
avoids getting the "entering/exiting directory" messages
included in the results.
-
- * ACE-RTEMS.README: Added requirement to configure C++
+
+ * ACE-RTEMS.README: Added requirement to configure C++
support in RTEMS. Updated to reflect also compiling for mc68360
target.
-
+
Wed Apr 11 20:36:36 2001 Nanbor Wang <nanbor@cs.wustl.edu>
* examples/Synch/proc_sema.cpp (main): Fixd an assigning string
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 163db36a03b..b5712152655 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,9 +1,17 @@
+Fri Apr 13 12:05:38 2001 Nanbor Wang <nanbor@cs.wustl.edu>
+
+ * tests/MEM_Stream_Test.cpp: Borland C++ has problem cleaning up
+ the static Atomic_Op object in Echo_Handler in the right order.
+ Made that an ACE_Singleton and re-organized the test a big.
+ Thanks to Chris Kohlhoff <chris@kohlhoff.com> for reporting and
+ suggesting the fix. [Bug 862]
+
Fri Apr 13 05:30:04 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* ace/Malloc_T.{h,i}: Added support for one of the calloc() methods
to ACE_Cached_Allocator. Thanks to Rachel G Smith
<Rachel_G_Smith@raytheon.com> for motivating this change.
-
+
* ace/Malloc_Allocator.h: Updated the comments for ACE_New_Allocator
to indicate that the calloc() methods are also supported.
Thanks to Rachel G Smith <Rachel_G_Smith@raytheon.com> for
@@ -57,17 +65,17 @@ Thu Apr 12 13:06:27 2001 Joel Sherrill <joel@OARcorp.com>
* include/makeinclude/Makefile.rtems: Replaced debug version
with real version that queries RTEMS application Makefile
infrastructure.
-
- * include/makeinclude/platform_rtems.x_g++.GNU: Added
+
+ * include/makeinclude/platform_rtems.x_g++.GNU: Added
--no-print-directory option to all invocations of recursive
make to determine information from Makefile.rtems. This
avoids getting the "entering/exiting directory" messages
included in the results.
-
- * ACE-RTEMS.README: Added requirement to configure C++
+
+ * ACE-RTEMS.README: Added requirement to configure C++
support in RTEMS. Updated to reflect also compiling for mc68360
target.
-
+
Wed Apr 11 20:36:36 2001 Nanbor Wang <nanbor@cs.wustl.edu>
* examples/Synch/proc_sema.cpp (main): Fixd an assigning string
diff --git a/tests/MEM_Stream_Test.cpp b/tests/MEM_Stream_Test.cpp
index 0f74c116751..c893ee6504f 100644
--- a/tests/MEM_Stream_Test.cpp
+++ b/tests/MEM_Stream_Test.cpp
@@ -26,6 +26,7 @@
#include "ace/Connector.h"
#include "ace/Acceptor.h"
#include "ace/Svc_Handler.h"
+#include "ace/Singleton.h"
ACE_RCSID(tests, MEM_Stream_Test, "$Id$")
@@ -40,12 +41,21 @@ static int opt_wfmo_reactor = 1;
static int opt_select_reactor = 1;
static ACE_MEM_IO::Signal_Strategy client_strategy = ACE_MEM_IO::Reactive;
-ACE_Atomic_Op <ACE_Thread_Mutex, u_short> Echo_Handler::waiting_ = NO_OF_CONNECTION;
-u_short Echo_Handler::connection_count_ = 0;
+typedef ACE_Atomic_Op <ACE_Thread_Mutex, u_short> WaitingCounter;
+typedef ACE_Singleton <WaitingCounter, ACE_Thread_Mutex> Waiting;
+
+// Number of connections that are currently open
+static u_short connection_count = 0;
typedef ACE_Acceptor<Echo_Handler, ACE_MEM_ACCEPTOR> ACCEPTOR;
typedef ACE_Strategy_Acceptor<Echo_Handler, ACE_MEM_ACCEPTOR> S_ACCEPTOR;
+static void reset_handler (void)
+{
+ (*Waiting::instance ()) = NO_OF_CONNECTION;
+ connection_count = 0;
+}
+
int
Echo_Handler::open (void *)
{
@@ -55,19 +65,12 @@ Echo_Handler::open (void *)
Echo_Handler::Echo_Handler (ACE_Thread_Manager *thr_mgr)
: ACE_Svc_Handler<ACE_MEM_STREAM, ACE_MT_SYNCH> (thr_mgr),
- connection_ (++Echo_Handler::connection_count_)
+ connection_ (++connection_count)
{
ACE_OS::sprintf (this->name_, ACE_TEXT ("Connection %d --> "),
this->connection_);
}
-void
-Echo_Handler::reset_handler (void)
-{
- Echo_Handler::waiting_ = NO_OF_CONNECTION;
- Echo_Handler::connection_count_ = 0;
-}
-
int
Echo_Handler::handle_input (ACE_HANDLE)
{
@@ -101,7 +104,7 @@ Echo_Handler::handle_close (ACE_HANDLE,
ACE_Reactor_Mask mask)
{
// Reduce count.
- this->waiting_--;
+ (*Waiting::instance ())--;
#if 1
if (client_strategy != ACE_MEM_IO::Reactive)
@@ -110,7 +113,7 @@ Echo_Handler::handle_close (ACE_HANDLE,
#endif /* tests */
// If no connections are open.
- if (this->waiting_ == 0)
+ if ((*Waiting::instance ()) == 0)
ACE_Reactor::instance ()->end_event_loop ();
ACE_DEBUG ((LM_DEBUG,
@@ -250,8 +253,6 @@ int test_multithreaded (ACE_MEM_Addr &server_addr)
{
ACE_DEBUG ((LM_DEBUG, "Testing Multithreaded MEM_Stream\n\n"));
- Echo_Handler::reset_handler ();
-
client_strategy = ACE_MEM_IO::MT;
ACE_Accept_Strategy<Echo_Handler, ACE_MEM_ACCEPTOR> accept_strategy;
ACE_Creation_Strategy<Echo_Handler> create_strategy;
@@ -317,10 +318,14 @@ main (int, ACE_TCHAR *[])
unsigned short port = 0;
ACE_MEM_Addr server_addr (port);
+ reset_handler ();
+
test_reactive (server_addr);
ACE_Reactor::instance ()->reset_event_loop ();
+ reset_handler ();
+
test_multithreaded (server_addr);
// Now testing
@@ -333,6 +338,7 @@ main (int, ACE_TCHAR *[])
template class ACE_Svc_Handler <ACE_MEM_STREAM, ACE_MT_SYNCH>;
template class ACE_Acceptor<Echo_Handler, ACE_MEM_ACCEPTOR>;
template class ACE_Atomic_Op<ACE_Thread_Mutex, u_short>;
+template class ACE_Singleton<ACE_Atomic_Op<ACE_Thread_Mutex, u_short>,ACE_Thread_Mutex>;
template class ACE_Accept_Strategy<Echo_Handler, ACE_MEM_ACCEPTOR>;
template class ACE_Creation_Strategy<Echo_Handler>;
template class ACE_Reactive_Strategy<Echo_Handler>;
@@ -344,6 +350,7 @@ template class ACE_Thread_Strategy<Echo_Handler>;
#pragma instantiate ACE_Svc_Handler <ACE_MEM_STREAM, ACE_MT_SYNCH>
#pragma instantiate ACE_Acceptor<Echo_Handler, ACE_MEM_ACCEPTOR>
#pragma instantiate ACE_Atomic_Op<ACE_Thread_Mutex, u_short>
+#pragma instantiate ACE_Singleton<ACE_Atomic_Op<ACE_Thread_Mutex, u_short>,ACE_Thread_Mutex>
#pragma instantiate ACE_Accept_Strategy<Echo_Handler, ACE_MEM_ACCEPTOR>
#pragma instantiate ACE_Creation_Strategy<Echo_Handler>
#pragma instantiate ACE_Reactive_Strategy<Echo_Handler>
diff --git a/tests/MEM_Stream_Test.h b/tests/MEM_Stream_Test.h
index a681e9486dd..eb13586847d 100644
--- a/tests/MEM_Stream_Test.h
+++ b/tests/MEM_Stream_Test.h
@@ -46,13 +46,6 @@ public:
// The Svc_Handler callbacks.
virtual int svc (void);
-public:
- static ACE_Atomic_Op <ACE_Thread_Mutex, u_short> waiting_;
- // How many connections are we waiting for.
-
- static u_short connection_count_;
- // How many connections are currently open
-
private:
ACE_TCHAR name_[MAXPATHLEN];
u_short connection_;