summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2005-06-29 16:38:41 +0000
committerSteve Huston <shuston@riverace.com>2005-06-29 16:38:41 +0000
commit7472ee508a901fbefce2ed65abf9b871773322b2 (patch)
tree8d487ae6868f7b39c9514f28e59c2dc88467b013
parent107fc9e0617eefea272d35e9e21d82287a6c858d (diff)
downloadATCD-7472ee508a901fbefce2ed65abf9b871773322b2.tar.gz
ChangeLogTag:Wed Jun 29 12:33:18 2005 Steve Huston <shuston@riverace.com>
-rw-r--r--ChangeLog27
-rw-r--r--THANKS1
-rw-r--r--ace/Timer_Heap_T.cpp10
-rw-r--r--examples/APG/Config/HA_Status.cpp32
-rw-r--r--examples/APG/Config/HA_Status.h85
-rw-r--r--examples/APG/Config/Makefile.am14
-rw-r--r--examples/APG/Config/config.mpc5
7 files changed, 55 insertions, 119 deletions
diff --git a/ChangeLog b/ChangeLog
index 82f0cd91f59..c3c7006e82f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,29 @@
+Wed Jun 29 12:33:18 2005 Steve Huston <shuston@riverace.com>
+
+ * examples/APG/Config/config.mpc:
+ * examples/APG/Config/Makefile.am:
+ * examples/APG/Config/HA_Status.cpp: Simplify greatly to build
+ HA_Status as a simple executable, not a DLL. Thanks to Gavin Yu
+ <songtaoyu at lucent dot com> for noticing this problem.
+
+ * examples/APG/Config/HA_Status.h: Removed.
+
+ * THANKS: Added Gavin Yu to the Hall of Fame.
+
+ * ace/Timer_Heap_T.cpp (dtor): When cleaning out the timer nodes,
+ free_node() before doing the deletion() upcall. Prevents a user's
+ handle_close() from doing a cancel_timer() and ripping the current
+ timer node out from under us and causing free_node() to assert().
+
Wed Jun 29 10:43:11 2005 Justin Michel <michel_j@ociweb.com>
* ace/OS_NS_Thread.cpp:
- Port the ACE_DISABLE_WIN32_INCREASE_PRIORITY feature from earlier OCI versions
- of ACE, so that a user can disable the setting of a thread to the realtime priority
- class. This prevents hard lockups of Windows machines when running as an
- administrator, and allows many tests to function when not running as an admin.
-
+ Port the ACE_DISABLE_WIN32_INCREASE_PRIORITY feature from earlier
+ OCI versions of ACE, so that a user can disable the setting of a
+ thread to the realtime priority class. This prevents hard lockups
+ of Windows machines when running as an administrator, and allows
+ many tests to function when not running as an admin.
Tue Jun 28 20:58:11 2005 J.T. Conklin <jtc@acorntoolworks.com>
diff --git a/THANKS b/THANKS
index e7b19391b43..6b4413ae19e 100644
--- a/THANKS
+++ b/THANKS
@@ -1993,6 +1993,7 @@ Dave Varnell <Dave dot Varvell at ni dot com>
Howard Finer <hfiner at sonusnet dot com>
Mark Callaghan <mdcallag at gmail dot com>
Hanson Lu <suf_lu at yahoo dot com>
+Gavin Yu <songtaoyu at lucent dot com>
I would particularly like to thank Paul Stephenson, who worked with me
at Ericsson in the early 1990's. Paul devised the recursive Makefile
diff --git a/ace/Timer_Heap_T.cpp b/ace/Timer_Heap_T.cpp
index 81224fa354b..a85c39020cd 100644
--- a/ace/Timer_Heap_T.cpp
+++ b/ace/Timer_Heap_T.cpp
@@ -182,10 +182,14 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Heap_T (void)
// Clean up all the nodes still in the queue
for (size_t i = 0; i < current_size; i++)
{
- this->upcall_functor ().deletion (*this,
- this->heap_[i]->get_type (),
- this->heap_[i]->get_act ());
+ // Grab the event_handler and act, then delete the node before calling
+ // back to the handler. Prevents a handler from trying to cancel_timer()
+ // inside handle_close(), ripping the current timer node out from
+ // under us.
+ TYPE eh = this->heap_[i]->get_type ();
+ const void *act = this->heap_[i]->get_act ();
this->free_node (this->heap_[i]);
+ this->upcall_functor ().deletion (*this, eh, act);
}
delete [] this->heap_;
diff --git a/examples/APG/Config/HA_Status.cpp b/examples/APG/Config/HA_Status.cpp
index dacee9ea654..1bad687be80 100644
--- a/examples/APG/Config/HA_Status.cpp
+++ b/examples/APG/Config/HA_Status.cpp
@@ -5,10 +5,23 @@
* Copyright 2003 Addison-Wesley. All Rights Reserved.
*/
+#include "ace/OS_NS_string.h"
#include "ace/Configuration.h"
#include "ace/Configuration_Import_Export.h"
#include "ace/Get_Opt.h"
-#include "HA_Status.h"
+#include "ace/Log_Msg.h"
+#include "ace/INET_Addr.h"
+#include "ace/Service_Object.h"
+
+class HA_Status : public ACE_Service_Object
+{
+public:
+ virtual int init (int argc, ACE_TCHAR *argv[]);
+
+private:
+ ACE_INET_Addr listen_addr_;
+};
+
int
HA_Status::init (int argc, ACE_TCHAR *argv[])
@@ -25,13 +38,13 @@ HA_Status::init (int argc, ACE_TCHAR *argv[])
return -1;
int option;
ACE_TCHAR config_file[MAXPATHLEN];
- ACE_OS_String::strcpy (config_file, ACE_TEXT ("HAStatus.conf"));
+ ACE_OS::strcpy (config_file, ACE_TEXT ("HAStatus.conf"));
while ((option = cmd_opts ()) != EOF)
switch (option) {
case 'f':
- ACE_OS_String::strncpy (config_file,
- cmd_opts.opt_arg (),
- MAXPATHLEN);
+ ACE_OS::strncpy (config_file,
+ cmd_opts.opt_arg (),
+ MAXPATHLEN);
break;
case ':':
ACE_ERROR_RETURN
@@ -83,12 +96,3 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
status.init (argc, argv);
return 0;
}
-
-// These are wrong, just here for an example
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
- template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>;
- template class ACE_Acceptor<ClientHandler, ACE_SOCK_ACCEPTOR>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-# pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>;
-# pragma instantiate ACE_Acceptor<ClientHandler, ACE_SOCK_ACCEPTOR>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/APG/Config/HA_Status.h b/examples/APG/Config/HA_Status.h
deleted file mode 100644
index a27937fa133..00000000000
--- a/examples/APG/Config/HA_Status.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * $Id$
- *
- * Home Automation Status server. Sample code from The ACE Programmer's Guide,
- * copyright 2003 Addison-Wesley. All Rights Reserved.
- */
-
-#ifndef __HASTATUS_H_
-#define __HASTATUS_H_
-
-#include "ace/OS.h"
-#include "ace/Acceptor.h"
-#include "ace/INET_Addr.h"
-#include "ace/SOCK_Stream.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/Service_Object.h"
-#include "ace/Svc_Handler.h"
-
-#include "HASTATUS_export.h"
-
-// Listing 10
-class ClientHandler :
- public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
-{
-public:
- typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> super;
-
- ClientHandler()
- : super()
- {
- // Exclude 10
- ACE_DEBUG(( LM_INFO,
- "ClientHandler ctor\n"
- ));
- // Exclude 10
- }
-// Listing 10
-
- ~ClientHandler()
- {
- ACE_DEBUG(( LM_INFO,
- "ClientHandler dtor\n"
- ));
- }
-
-// Listing 13
- int handle_input (ACE_HANDLE)
- {
- char buf[64];
- int bytesReceived;
-
- if( (bytesReceived =
- this->peer_.recv( buf, sizeof(buf)-1 )) < 1 )
- {
- ACE_DEBUG(( LM_INFO,
- "ClientHandler handle_input: "
- "Received %d bytes. Leaving.\n",
- bytesReceived
- ));
- return -1;
- }
-
- buf[bytesReceived] = 0;
- ACE_DEBUG(( LM_INFO,
- "ClientHandler handle_input: %s\n",
- buf
- ));
-
- return 0;
- }
-};
-// Listing 13
-
-
-class HASTATUS_Export HA_Status : public ACE_Service_Object
-{
-public:
- virtual int init (int argc, ACE_TCHAR *argv[]);
-
-private:
- ACE_Acceptor<ClientHandler, ACE_SOCK_ACCEPTOR> acceptor_;
- ACE_INET_Addr listen_addr_;
-};
-
-#endif /* __HASTATUS_H_ */
diff --git a/examples/APG/Config/Makefile.am b/examples/APG/Config/Makefile.am
index 968baca94c6..e22ca8ea1ff 100644
--- a/examples/APG/Config/Makefile.am
+++ b/examples/APG/Config/Makefile.am
@@ -27,22 +27,18 @@ ARGV_Example_LDADD = \
$(top_builddir)/ace/libACE.la
## Makefile.Config_HA_Status.am
-noinst_LTLIBRARIES = libHA_Status.la
+noinst_PROGRAMS += HA_Status
-libHA_Status_la_CPPFLAGS = \
+HA_Status_CPPFLAGS = \
-I$(ACE_ROOT) \
- -I$(ACE_BUILDDIR) \
- -DHASTATUS_BUILD_DLL
+ -I$(ACE_BUILDDIR)
-libHA_Status_la_SOURCES = \
+HA_Status_SOURCES = \
HA_Status.cpp
-libHA_Status_la_LIBADD = \
+HA_Status_LDADD = \
$(top_builddir)/ace/libACE.la
-noinst_HEADERS = \
- HA_Status.h
-
## Makefile.Get_Opt.am
noinst_PROGRAMS += Get_Opt
diff --git a/examples/APG/Config/config.mpc b/examples/APG/Config/config.mpc
index f1e2668bfae..bd2aa0fcb99 100644
--- a/examples/APG/Config/config.mpc
+++ b/examples/APG/Config/config.mpc
@@ -1,9 +1,8 @@
// -*- MPC -*-
// $Id$
-project(*HA Status) : acelib {
- sharedname = HA_Status
- dynamicflags = HASTATUS_BUILD_DLL
+project(*HA Status) : aceexe {
+ exename = HA_Status
Source_Files {
HA_Status.cpp
}