summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog-96b89
-rw-r--r--README1
-rw-r--r--ace/Acceptor.cpp79
-rw-r--r--ace/Acceptor.h22
-rw-r--r--ace/CORBA_Handler.h4
-rw-r--r--ace/Event_Handler.h31
-rw-r--r--ace/Event_Handler.i50
-rw-r--r--ace/Malloc_T.cpp2
-rw-r--r--ace/Malloc_T.h2
-rw-r--r--ace/OS.cpp58
-rw-r--r--ace/OS.h154
-rw-r--r--ace/OS.i28
-rw-r--r--ace/Proactor.cpp8
-rw-r--r--ace/Proactor.h1
-rw-r--r--ace/README5
-rw-r--r--ace/Reactor.cpp9
-rw-r--r--ace/ReactorEx.cpp14
-rw-r--r--ace/SString.cpp13
-rw-r--r--ace/Service_Config.cpp35
-rw-r--r--ace/Service_Config.h18
-rw-r--r--ace/Signal.h1
-rw-r--r--ace/Stack.cpp28
-rw-r--r--ace/Stack.h7
-rw-r--r--ace/Svc_Conf_l.cpp8
-rw-r--r--ace/Svc_Handler.cpp36
-rw-r--r--ace/Svc_Handler.h10
-rw-r--r--ace/Task_T.h5
-rw-r--r--ace/Thread_Manager.cpp2
-rw-r--r--ace/Time_Value.h10
-rw-r--r--ace/XtReactor.h2
-rw-r--r--ace/config-hpux-10.x.h4
-rw-r--r--ace/config-irix6.2-sgic++.h4
-rw-r--r--ace/config-linux-pthread.h2
-rw-r--r--ace/config-sunos4-sun3.x.h9
-rw-r--r--ace/config-vxworks-ghs-1.8.h4
-rw-r--r--ace/config-vxworks5.2-g++.h2
-rw-r--r--ace/config-win32-msvc2.0.h2
-rw-r--r--ace/config-win32-msvc4.0.h8
-rw-r--r--ace/stdcpp.h30
39 files changed, 445 insertions, 352 deletions
diff --git a/ChangeLog-96b b/ChangeLog-96b
index e84bb100fa4..ac4aa8f0a75 100644
--- a/ChangeLog-96b
+++ b/ChangeLog-96b
@@ -1,10 +1,80 @@
-Thu Nov 21 08:12:51 1996 David L. Levine <levine@cs.wustl.edu>
- * include/makeinclude/platform_sunos5_sunc++_4.1.GNU:
- put back the LD definition
- * include/makeinclude/platform_osf1_4.0_g++.GNU:
- added LD definition to work with latest wrapper_macros.GNU
+Thu Nov 21 10:37:40 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/Service_Config: Changed the implementation of the
+ Service_Config class so that it no longer inherits from
+ ACE_Event_Handler. This was causing problems because the new
+ reactor() method in the ACE_Event_Handler was conflicting with
+ the static reactor() method on ACE_Service_Config.
+
+ * ace/OS.cpp (detach): Since we no longer use an
+ ACE_Recursive_Thread_Mutex, we can remove the line
+
+ else if (ACE_TSS_Cleanup::lock_.get_nesting_level () > 1)
+ // ...
+
+ Thanks to Matthias Kerkhoff <make@cs.tu-berlin.de> for
+ reporting this.
+
+ * ace/Thread_Manager.cpp (spawn_n): Replaced int i with size_t i
+ to avoid warnings between signed and unsigned values.
+
+ * ace: There is an easy way to speed up the "Update dependencies"
+ in MSVC. Just keep the the compiler from complaining about
+ missing header by inserting a comment like below in the
+ #include-directives which are not used in Win32.
+
+ Therefore, instead of
+
+ #include <somefile.h>
+
+ we use
+
+ #include /**/ <somefile.h>
+
+ Please let me know if this causes problems for any
+ pre-processors. Thanks to Matthias Kerkhoff
+ <make@cs.tu-berlin.de> for this suggestion!
+
+ * ace/OS.cpp: Added support for AfxBeginThread in
+ ACE_OS::thr_create(). Thanks to Matthias Kerkhoff
+ <make@cs.tu-berlin.de> for this!
+
+ * ace/Malloc_T.cpp (avail_chunks): Changed the return value to
+ ssize_t so we can return -1 if we can't get the lock. Thanks to
+ Tilo for reporting this.
-Thu Nov 21 00:12:42 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+ * ace/config-sunos4-sun3.x.h: Added new #ifdefs for Sun C++ 3.0.1
+ on SunOS 4.1.3. Thanks to Eric Parker <eparker@credence.com>
+ for these fixes.
+
+ * ace/Stack.h: Added a new method called peek() to the
+ ACE_Unbounded_Queue classes so that the first element can be
+ retrieved without removing it. Thanks to Luca for this
+ suggestion.
+
+ * ace/SString.cpp (ACE_CString): Changed ACE_CString so that it
+ uses memcpy() rather than str(n)cpy() so that we can store any
+ structure into it. Thanks to Luca for this suggestion.
+
+ * ace/Acceptor: Since we moved the reactor() accessors to
+ ACE_Event_Handler we can omit these from the Acceptor and
+ Svc_Handler.
+
+ * ace: Updated the ACE_Reactor and ACE_ReactorEx so that they
+ automatically sets the pointers in ACE_Event_Handlers. Thanks
+ to Luca for this suggestion.
+
+ * ace/Event_Handler: Added pointers to all the ACE demultiplexors
+ (e.g., ACE_Reactor, ACE_ReactorEx, and ACE_Proactor) to
+ ACE_Event_Handler, along with set/get accessor methods. This
+ supports a very common use-case where an event handler keeps
+ track of its demultiplexor. Thanks to Luca for this suggestion.
+
+ * ace/OS.cpp: Since we do not use the recursion count from the
+ Recursive Mutex any more in ACE_TSS_Cleanup::exit() we can
+ replace the Recursive Mutex by a regular ACE_Thread_Mutex that
+ is recursive on NT natively and more efficient. Thanks to
+ Detlef for suggesting this.
* ace/OS.cpp: Since we do not use the recursion count from the
Recursive Mutex any more in ACE_TSS_Cleanup::exit() we can
@@ -18,6 +88,13 @@ Thu Nov 21 00:12:42 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
hold the lock when callbacks are made. Once again, Detlef
proves that he's a macho man, not a boy ;-)
+Thu Nov 21 08:12:51 1996 David L. Levine <levine@cs.wustl.edu>
+ * include/makeinclude/platform_sunos5_sunc++_4.1.GNU:
+ put back the LD definition
+
+ * include/makeinclude/platform_osf1_4.0_g++.GNU:
+ added LD definition to work with latest wrapper_macros.GNU
+
Wed Nov 20 21:35:28 1996 David L. Levine <levine@cs.wustl.edu>
* ace/Svc_Conf_l.cpp: added #include of ace/config.h so that
conditions for include of ace/OS.h can be checked
diff --git a/README b/README
index 3d17df5696b..cc41744f0e1 100644
--- a/README
+++ b/README
@@ -660,6 +660,7 @@ Thilo Kielmann <kielmann@informatik.uni-siegen.de>
Matthias Kerkhoff <make@cs.tu-berlin.de>
Fred LaBar <flabar@fallschurch.esys.com>
Hanan Herzog <hanan@wallenda.stanford.edu>
+Eric Parker <eparker@credence.com>
I would particularly like to thank Paul Stephenson, who worked with me
at Ericsson and is now at ObjectSpace. Paul devised the recursive
diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp
index a54aa8d69fa..d770af37146 100644
--- a/ace/Acceptor.cpp
+++ b/ace/Acceptor.cpp
@@ -16,7 +16,6 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::dump (void) const
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
- ACE_DEBUG ((LM_DEBUG, "reactor_ = %x", this->reactor_));
this->peer_acceptor_.dump ();
ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
}
@@ -28,20 +27,6 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::operator ACE_PEER_ACCEPTOR & ()
return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_;
}
-template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_Reactor *
-ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::reactor (void) const
-{
- ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::reactor");
- return this->reactor_;
-}
-
-template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> void
-ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::reactor (ACE_Reactor *r)
-{
- ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::reactor");
- this->reactor_ = r;
-}
-
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_PEER_ACCEPTOR &
ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::acceptor (void) const
{
@@ -69,7 +54,7 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
ACE_Reactor *reactor)
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open");
- this->reactor_ = reactor;
+ this->reactor (reactor);
// Must supply a valid Reactor to Acceptor::open()...
@@ -82,7 +67,7 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
if (this->peer_acceptor_.open (local_addr, 1) == -1)
return -1;
- return this->reactor_->register_handler
+ return this->reactor ()->register_handler
(this, ACE_Event_Handler::READ_MASK);
}
@@ -90,9 +75,10 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Acceptor (ACE_Reactor *reactor)
- : reactor_ (reactor)
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Acceptor");
+
+ this->reactor (reactor);
}
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
@@ -156,18 +142,18 @@ template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::suspend (void)
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::suspend");
- return this->reactor_->suspend_handler (this);
+ return this->reactor ()->suspend_handler (this);
}
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::resume (void)
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::resume");
- return this->reactor_->resume_handler (this);
+ return this->reactor ()->resume_handler (this);
}
// Perform termination activities when <this> is removed from the
-// <reactor_>.
+// <reactor>.
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_close (ACE_HANDLE,
@@ -175,7 +161,7 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_close (ACE_HANDLE,
{
ACE_TRACE ("ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_close");
// Guard against multiple closes.
- if (this->reactor_ != 0)
+ if (this->reactor () != 0)
{
ACE_HANDLE handle = this->get_handle ();
@@ -184,8 +170,6 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_close (ACE_HANDLE,
this->reactor_->remove_handler
(handle, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL);
-
- this->reactor_ = 0;
}
return 0;
}
@@ -445,8 +429,8 @@ ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
}
this->scheduling_strategy_ = sch_s;
- return this->reactor ()->register_handler (this,
- ACE_Event_Handler::READ_MASK);
+ return this->reactor ()->register_handler
+ (this, ACE_Event_Handler::READ_MASK);
}
// Simple constructor.
@@ -529,8 +513,6 @@ ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_close (ACE_HANDL
this->reactor ()->remove_handler
(handle, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL);
-
- this->reactor (0);
}
return 0;
}
@@ -640,7 +622,6 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::dump (void) const
ACE_TRACE ("ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::dump");
ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
- ACE_DEBUG ((LM_DEBUG, "reactor_ = %x", this->reactor_));
ACE_DEBUG ((LM_DEBUG, "\nsvc_handler_ = %x", this->svc_handler_));
ACE_DEBUG ((LM_DEBUG, "\nrestart_ = %d", this->restart_));
this->peer_acceptor_.dump ();
@@ -674,10 +655,10 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::open
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Oneshot_Acceptor (void)
- : reactor_ (0),
- delete_concurrency_strategy_ (0)
+ : delete_concurrency_strategy_ (0)
{
ACE_TRACE ("ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Oneshot_Acceptor");
+ this->reactor (0);
}
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1>
@@ -716,11 +697,9 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_close (ACE_HANDLE
// Note that if we aren't actually registered with the
// ACE_Reactor then it's ok for this call to fail...
- this->reactor_ && this->reactor_->remove_handler
+ this->reactor () && this->reactor ()->remove_handler
(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL);
- this->reactor_ = 0;
-
if (this->peer_acceptor_.close () == -1)
ACE_ERROR ((LM_ERROR, "close\n"));
}
@@ -738,7 +717,7 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_timeout
// Since we aren't necessarily registered with the Reactor, don't
// bother to check the return value here...
- this->reactor_ && this->reactor_->remove_handler
+ this->reactor () && this->reactor ()->remove_handler
(this, ACE_Event_Handler::READ_MASK);
return 0;
}
@@ -747,7 +726,7 @@ template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::cancel (void)
{
ACE_TRACE ("ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::cancel");
- return this->reactor_ && this->reactor_->cancel_timer (this);
+ return this->reactor () && this->reactor ()->cancel_timer (this);
}
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
@@ -758,7 +737,7 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::register_handler
{
ACE_TRACE ("ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::register_handler");
// Can't do this if we don't have a Reactor.
- if (this->reactor_ == 0)
+ if (this->reactor () == 0)
return -1;
else
{
@@ -767,12 +746,12 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::register_handler
ACE_Time_Value *tv = (ACE_Time_Value *) synch_options.time_value ();
if (tv != 0
- && this->reactor_->schedule_timer (this, synch_options.arg (),
+ && this->reactor ()->schedule_timer (this, synch_options.arg (),
*tv) == 0)
return -1;
else
- return this->reactor_->register_handler (this,
- ACE_Event_Handler::READ_MASK);
+ return this->reactor ()->register_handler (this,
+ ACE_Event_Handler::READ_MASK);
}
}
@@ -876,7 +855,7 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_input (ACE_HANDLE
if (this->shared_accept (this->svc_handler_, 0, 0, this->restart_) == -1)
result = -1;
- if (this->reactor_ && this->reactor_->remove_handler
+ if (this->reactor () && this->reactor ()->remove_handler
(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL) == -1)
result = -1;
return result;
@@ -926,14 +905,14 @@ template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::suspend (void)
{
ACE_TRACE ("ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::suspend");
- return this->reactor_ && this->reactor_->suspend_handler (this);
+ return this->reactor () && this->reactor ()->suspend_handler (this);
}
template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int
ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::resume (void)
{
ACE_TRACE ("ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::resume");
- return this->reactor_ && this->reactor_->resume_handler (this);
+ return this->reactor () && this->reactor ()->resume_handler (this);
}
// Returns ACE_HANDLE of the underlying peer_acceptor.
@@ -959,18 +938,4 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::operator ACE_PEER_ACCEPT
return (ACE_PEER_ACCEPTOR &) this->peer_acceptor_;
}
-template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_Reactor *
-ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::reactor (void) const
-{
- ACE_TRACE ("ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::reactor");
- return this->reactor_;
-}
-
-template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> void
-ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::reactor (ACE_Reactor *r)
-{
- ACE_TRACE ("ACE_Oneshot_Acceptor<SH, ACE_PEER_ACCEPTOR_2>::reactor");
- this->reactor_ = r;
-}
-
#endif /* ACE_ACCEPTOR_C */
diff --git a/ace/Acceptor.h b/ace/Acceptor.h
index 9b9ab8410bf..7071af03800 100644
--- a/ace/Acceptor.h
+++ b/ace/Acceptor.h
@@ -71,12 +71,6 @@ public:
virtual ACE_PEER_ACCEPTOR &acceptor (void) const;
// Return the underlying PEER_ACCEPTOR object.
- ACE_Reactor *reactor (void) const;
- // Get the underlying Reactor *.
-
- void reactor (ACE_Reactor *);
- // Set the underlying Reactor *.
-
virtual ACE_HANDLE get_handle (void) const;
// Returns the listening acceptor's <ACE_HANDLE>.
@@ -117,7 +111,7 @@ protected:
virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
ACE_Reactor_Mask = ACE_Event_Handler::RWE_MASK);
// Perform termination activities when <this> is removed from the
- // <reactor_>.
+ // <reactor>.
virtual int handle_input (ACE_HANDLE);
// Accepts all pending connections from clients, and creates and
@@ -142,9 +136,6 @@ protected:
// This method calls <Reactor::resume>.
private:
- ACE_Reactor *reactor_;
- // Event demultiplexer associated with this object.
-
ACE_PEER_ACCEPTOR peer_acceptor_;
// Concrete factory for accepting connections from clients...
};
@@ -373,12 +364,6 @@ public:
virtual ACE_PEER_ACCEPTOR &acceptor (void) const;
// Return the underlying PEER_ACCEPTOR object.
- ACE_Reactor *reactor (void) const;
- // Get the underlying Reactor *.
-
- void reactor (ACE_Reactor *);
- // Set the underlying Reactor *.
-
void dump (void) const;
// Dump the state of an object.
@@ -414,7 +399,7 @@ protected:
virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
ACE_Reactor_Mask = ACE_Event_Handler::RWE_MASK);
// Perform termination activities when <this> is removed from the
- // <reactor_>.
+ // <reactor>.
virtual int handle_input (ACE_HANDLE);
// Accept one connection from a client and activates the
@@ -446,9 +431,6 @@ protected:
// by application developer to do anything meaningful.
private:
- ACE_Reactor *reactor_;
- // Event demultiplexer associated with this object.
-
SVC_HANDLER *svc_handler_;
// Hold the svc_handler_ across asynchrony boundaries.
diff --git a/ace/CORBA_Handler.h b/ace/CORBA_Handler.h
index 4180600e85e..d6d15656563 100644
--- a/ace/CORBA_Handler.h
+++ b/ace/CORBA_Handler.h
@@ -25,8 +25,8 @@
#if defined (ACE_HAS_ORBIX) || defined (ACE_HAS_MT_ORBIX)
#define EXCEPTIONS
#define WANT_ORBIX_FDS
-#include <CORBA.h>
-// #include <daemon.hh>
+#include /**/ <CORBA.h>
+// #include /**/ <daemon.hh>
#undef EXCEPTIONS
#undef WANT_ORBIX_FDS
diff --git a/ace/Event_Handler.h b/ace/Event_Handler.h
index bb90a0e7c15..cad6955dfff 100644
--- a/ace/Event_Handler.h
+++ b/ace/Event_Handler.h
@@ -21,6 +21,9 @@
// Forward declaration.
class ACE_Message_Block;
+class ACE_Reactor;
+class ACE_ReactorEx;
+class ACE_Proactor;
typedef u_long ACE_Reactor_Mask;
@@ -64,8 +67,7 @@ public:
virtual void set_handle (ACE_HANDLE);
// Set the I/O handle.
- // = Priority runs from MIN_PRIORITY (which is the "lowest
- // priority") to MAX_PRIORITY (which is the "highest priority").
+ // = Priority runs from MIN_PRIORITY (which is the "lowest priority") to MAX_PRIORITY (which is the "highest priority").
virtual int get_priority (void) const;
// Get the priority of the Event_Handler.
virtual void set_priority (int priority);
@@ -93,15 +95,7 @@ public:
// Called when object is signaled by OS (either via UNIX signals or
// when a Win32 object becomes signaled).
- // = <ACE_Proactor> callbacks.
- // Win32 specific. An Event_Handler can be given to a Proactor
- // with a {RECV,SEND}_MASK. The Proactor calls back
- // <get_message> and <get_handle> to perform the correct
- // operations (send/recv). When the send/recv is complete,
- // handle_{input,output} is called. Thus, Event_Handlers are
- // used for "proactive I/O" where they are told WHEN THE
- // OPERATION IS COMPLETE. Alternatively, the _Reactor_ tells
- // Event_Handlers WHEN THE OPERATION CAN BE PERFORMED.
+ // = <ACE_Proactor> callbacks. These are Win32 specific. An Event_Handler can be given to a Proactor with a {RECV,SEND}_MASK. The Proactor calls back <get_message> and <get_handle> to perform the correct operations (send/recv). When the send/recv is complete, handle_{input,output} is called. Thus, Event_Handlers are used for "proactive I/O" where they are told WHEN THE OPERATION IS COMPLETE. Alternatively, the _Reactor_ tells Event_Handlers WHEN THE OPERATION CAN BE PERFORMED.
virtual int handle_input_complete (ACE_Message_Block *message,
long bytes_transferred);
@@ -134,12 +128,27 @@ public:
// <Event_Handler> with its contents filled in. By default,
// get_message dynamically creates a new ACE_Message_Block.
+ // = Accessors to set/get the various event demultiplexors.
+ virtual void reactor (ACE_Reactor *reactor);
+ virtual ACE_Reactor *reactor (void) const;
+
+ virtual void reactorex (ACE_ReactorEx *reactorex);
+ virtual ACE_ReactorEx *reactorex (void) const;
+
+ virtual void proactor (ACE_Proactor *proactor);
+ virtual ACE_Proactor *proactor (void) const;
+
protected:
ACE_Event_Handler (void);
// Force ACE_Event_Handler to be an abstract base class.
int priority_;
// Priority of this Event_Handler.
+
+ // = Pointers to the various event demultiplexors.
+ ACE_Reactor *reactor_;
+ ACE_ReactorEx *reactorex_;
+ ACE_Proactor *proactor_;
};
#if defined (__ACE_INLINE__)
diff --git a/ace/Event_Handler.i b/ace/Event_Handler.i
index afbc1a43c8b..d9e30724ce5 100644
--- a/ace/Event_Handler.i
+++ b/ace/Event_Handler.i
@@ -9,7 +9,10 @@
ACE_INLINE
ACE_Event_Handler::ACE_Event_Handler (void)
- : priority_ (ACE_Event_Handler::LO_PRIORITY)
+ : priority_ (ACE_Event_Handler::LO_PRIORITY),
+ reactor_ (0),
+ reactorex_ (0),
+ proactor_ (0)
{
ACE_TRACE ("ACE_Event_Handler::ACE_Event_Handler");
}
@@ -131,3 +134,48 @@ ACE_Event_Handler::get_message (void)
return 0;
}
+ACE_INLINE void
+ACE_Event_Handler::reactor (ACE_Reactor *reactor)
+{
+ ACE_TRACE ("ACE_Event_Handler::reactor");
+ this->reactor_ = reactor;
+}
+
+ACE_INLINE ACE_Reactor *
+ACE_Event_Handler::reactor (void) const
+{
+ ACE_TRACE ("ACE_Event_Handler::Reactor");
+ return this->reactor_;
+}
+
+ACE_INLINE void
+ACE_Event_Handler::reactorex (ACE_ReactorEx *reactorex)
+{
+ ACE_TRACE ("ACE_Event_Handler::reactorex");
+ this->reactorex_ = reactorex;
+}
+
+ACE_INLINE ACE_ReactorEx *
+ACE_Event_Handler::reactorex (void) const
+{
+ ACE_TRACE ("ACE_Event_Handler::ReactorEx");
+
+ return this->reactorex_;
+}
+
+ACE_INLINE void
+ACE_Event_Handler::proactor (ACE_Proactor *proactor)
+{
+ ACE_TRACE ("ACE_Event_Handler::proactor");
+
+ this->proactor_ = proactor;
+}
+
+ACE_INLINE ACE_Proactor *
+ACE_Event_Handler::proactor (void) const
+{
+ ACE_TRACE ("ACE_Event_Handler::Proactor");
+
+ return this->proactor_;
+}
+
diff --git a/ace/Malloc_T.cpp b/ace/Malloc_T.cpp
index ee524474e9f..139e0f624be 100644
--- a/ace/Malloc_T.cpp
+++ b/ace/Malloc_T.cpp
@@ -462,7 +462,7 @@ ACE_Malloc<ACE_MEM_POOL_2, LOCK>::find (const char *name, void *&pointer)
// @return function returns the number of chunks of the given size
// that would fit in the currently allocated memory
-template <ACE_MEM_POOL_1, class LOCK> size_t
+template <ACE_MEM_POOL_1, class LOCK> ssize_t
ACE_Malloc<ACE_MEM_POOL_2, LOCK>::avail_chunks (size_t size) const
{
ACE_TRACE ("ACE_Malloc<ACE_MEM_POOL_2, LOCK>::avail_chunks");
diff --git a/ace/Malloc_T.h b/ace/Malloc_T.h
index 287117dac1f..37ba9ab7a21 100644
--- a/ace/Malloc_T.h
+++ b/ace/Malloc_T.h
@@ -262,7 +262,7 @@ public:
// Change the protection of the pages of the mapped region to <prot>
// starting at <addr> up to <len> bytes.
- size_t avail_chunks (size_t size) const;
+ ssize_t avail_chunks (size_t size) const;
// Returns a count of the number of available chunks that can hold
// <size> byte allocations. Function can be used to determine if you
// have reached a water mark. This implies a fixed amount of allocated
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 2510d3da1cd..916f6a2adc6 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -296,7 +296,7 @@ private:
// Pointer to the singleton instance.
public:
- static ACE_Recursive_Thread_Mutex lock_;
+ static ACE_Thread_Mutex lock_;
// Serialize initialization of <key_>.
};
@@ -306,7 +306,7 @@ public:
ACE_TSS_Cleanup *ACE_TSS_Cleanup::instance_ = 0;
// Serialize initialization of <key_>.
-ACE_Recursive_Thread_Mutex ACE_TSS_Cleanup::lock_;
+ACE_Thread_Mutex ACE_TSS_Cleanup::lock_;
int
ACE_TSS_Cleanup::mark_cleanup_i (void)
@@ -342,7 +342,7 @@ ACE_TSS_Cleanup::exit (void *status)
// in an array without invoking the according destructors.
{
- ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_);
+ ACE_GUARD (ACE_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_);
// Prevent recursive deletions
@@ -394,7 +394,7 @@ ACE_TSS_Cleanup::exit (void *status)
// Acquiring ACE_TSS_Cleanup::lock_ to free TLS keys and remove
// entries from ACE_TSS_Info table.
{
- ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_);
+ ACE_GUARD (ACE_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_);
for (int i = 0; i < index; i++)
{
@@ -405,10 +405,17 @@ ACE_TSS_Cleanup::exit (void *status)
this->exit_cleanup_i (); // remove thread id from reference list.
}
+#if defined (ACE_HAS_MFC)
+ // allow CWinThread-destructor to be invoked from AfxEndThread
+ // _endthreadex() will be called from AfxEndThread so don't exit the
+ // thread now if we are running an MFC thread.
+ // if (ACE_BIT_DISABLED (flags, THR_USE_AFX))
+#endif /* ACE_HAS_MFC */
+ ::_endthreadex ((DWORD) status);
+
#if 0
::ExitThread ((DWORD) status);
#endif
- ::_endthreadex ((DWORD) status);
/* NOTREACHED */
}
@@ -427,7 +434,7 @@ ACE_TSS_Cleanup::instance (void)
if (ACE_TSS_Cleanup::instance_ == 0)
{
// Insure that we are serialized!
- ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, 0);
+ ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, 0);
// Now, use the Double-Checked Locking pattern to make sure we
// only create the key once.
@@ -444,7 +451,7 @@ ACE_TSS_Cleanup::insert (ACE_thread_key_t key,
void *inst)
{
// ACE_TRACE ("ACE_TSS_Cleanup::insert");
- ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, -1);
+ ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, -1);
return this->table_.insert (ACE_TSS_Info (key, destructor, inst));
}
@@ -453,7 +460,7 @@ int
ACE_TSS_Cleanup::remove (ACE_thread_key_t key)
{
// ACE_TRACE ("ACE_TSS_Cleanup::remove");
- ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, -1);
+ ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, -1);
return this->table_.remove (ACE_TSS_Info (key));
}
@@ -461,7 +468,7 @@ ACE_TSS_Cleanup::remove (ACE_thread_key_t key)
int
ACE_TSS_Cleanup::detach (void *inst)
{
- ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, -1);
+ ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, -1);
ACE_TSS_Info *key_info = 0;
int success = 0;
@@ -482,8 +489,6 @@ ACE_TSS_Cleanup::detach (void *inst)
if (success == 0)
return -1;
- else if (ACE_TSS_Cleanup::lock_.get_nesting_level () > 1)
- ACE_ERROR_RETURN ((LM_DEBUG, "Detach() invoked from ACE_TSS_Cleanup::exit()\n"), 0);
else if (ref_cnt == 0)
{
::TlsFree (key_info->key_);
@@ -502,7 +507,7 @@ ACE_TSS_Cleanup::detach (ACE_thread_key_t key, ACE_thread_t tid)
int
ACE_TSS_Cleanup::key_used (ACE_thread_key_t key)
{
- ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, -1);
+ ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, ACE_TSS_Cleanup::lock_, -1);
ACE_TSS_Info *key_info = 0;
@@ -866,14 +871,27 @@ ACE_OS::thr_create (ACE_THR_FUNC func,
#if defined (ACE_HAS_MFC)
if (ACE_BIT_ENABLED (flags, THR_USE_AFX))
- {
- CWinThread *cwin_thread =
- // These aren't the right arguments (yet).
- ::AfxBeginThread ((ThreadFunc) (ACE_Win32_Thread_Adapter::svc_run),
- thread_args, 0, 0, flags);
- *thr_handle = cwin_thread->m_hThread;
- *thr_id = cwin_thread->m_nThreadID;
- // Can we delete the memory of cwin_thread here?
+ {
+ CWinThread *cwin_thread =
+ ::AfxBeginThread ((ThreadFunc) (ACE_Win32_Thread_Adapter::svc_run),
+ thread_args, 0, 0, flags | THR_SUSPENDED);
+ // Have to duplicate the handle because
+ // CWinThread::~CWinThread() closes the original handle.
+ *thr_handle = ::DuplicateHandle (::GetCurrentProcess (),
+ cwin_thread->m_hThread,
+ ::GetCurrentProcess (),
+ thr_handle,
+ 0,
+ TRUE,
+ DUPLICATE_SAME_ACCESS);
+
+ *thr_id = cwin_thread->m_nThreadID;
+ if (ACE_BIT_ENABLED (flags, THR_SUSPENDED) == 0)
+ cwin_thread->ResumeThread ();
+ // cwin_thread will be deleted in AfxThreadExit()
+ // Warning: If AfxThreadExit() is called from within the
+ // thread, ACE_TSS_Cleanup->exit() never gets called !
+
}
else
#endif /* ACE_HAS_MFC */
diff --git a/ace/OS.h b/ace/OS.h
index 48f74c9771c..4cd84cda48a 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -182,11 +182,11 @@
// horrible hacks to get around inconsistency between ansi and VxWorks
// stdarg.h with Green Hills 1.8.8 compiler
#define __INCstdargh
-#include <stdarg.h>
+#include /**/ <stdarg.h>
#endif /* ghs */
typedef int key_t;
-#include <vxWorks.h>
+#include /**/ <vxWorks.h>
#endif /* VXWORKS */
#include "ace/Time_Value.h"
@@ -396,11 +396,11 @@ struct strrecvfd {};
#endif /* ACE_LACKS_STRRECVFD */
#if defined (ACE_HAS_PROC_FS)
-#include <sys/procfs.h>
+#include /**/ <sys/procfs.h>
#endif /* ACE_HAS_PROC_FD */
#if defined (ACE_HAS_UNICODE)
-#include <wchar.h>
+#include /**/ <wchar.h>
#endif /* ACE_HAS_UNICODE */
#if defined (ACE_HAS_BROKEN_WRITEV)
@@ -493,7 +493,7 @@ enum ACE_Thread_State
if (OBJ.locked () == 0) return;
#if defined (ACE_HAS_POSIX_SEM)
-#include <semaphore.h>
+#include /**/ <semaphore.h>
typedef struct
{
sem_t *sema_;
@@ -519,8 +519,8 @@ struct cancel_state
#if defined (ACE_HAS_THREADS)
#if defined (ACE_HAS_STHREADS)
-#include <synch.h>
-#include <thread.h>
+#include /**/ <synch.h>
+#include /**/ <thread.h>
#endif /* ACE_HAS_STHREADS */
#if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS)
@@ -703,9 +703,9 @@ typedef ACE_mutex_t ACE_thread_mutex_t;
#define THR_CANCEL_DEFERRED 0
#define THR_CANCEL_ASYNCHRONOUS 0
#elif defined(VXWORKS)
-#include <semLib.h> // for mutex implementation using mutual-exclusion
+#include /**/ <semLib.h> // for mutex implementation using mutual-exclusion
// semaphores (which can be taken recursively)
-#include <taskLib.h>
+#include /**/ <taskLib.h>
// task options: the other options are either obsolete, internal, or for
// Fortran or Ada support
@@ -810,20 +810,20 @@ typedef int ACE_thread_t;
typedef int ACE_hthread_t;
typedef int ACE_thread_key_t;
#endif /* ACE_HAS_THREADS */
-#include <sys/types.h>
-#include <assert.h>
-#include <sys/stat.h>
-#include <limits.h>
-#include <stdio.h>
+#include /**/ <sys/types.h>
+#include /**/ <assert.h>
+#include /**/ <sys/stat.h>
+#include /**/ <limits.h>
+#include /**/ <stdio.h>
#include "ace/stdcpp.h"
-#include <new.h>
-#include <ctype.h>
-#include <signal.h>
-#include <string.h>
-#include <stdarg.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdlib.h>
+#include /**/ <new.h>
+#include /**/ <ctype.h>
+#include /**/ <signal.h>
+#include /**/ <string.h>
+#include /**/ <stdarg.h>
+#include /**/ <fcntl.h>
+#include /**/ <errno.h>
+#include /**/ <stdlib.h>
// This must come after signal.h is #included.
#if defined (SCO)
@@ -854,7 +854,7 @@ typedef unsigned int *ACE_RANDR_TYPE;
#endif /* !ACE_HAS_RTLD_LAZY_V */
#if defined (ACE_HAS_UTIME)
-#include <utime.h>
+#include /**/ <utime.h>
#endif /* ACE_HAS_UTIME */
#if !defined (ACE_HAS_MSG) && !defined (SCO)
@@ -945,7 +945,7 @@ typedef void (*ACE_SignalHandlerV)(...);
#define STRICT
#endif /* ACE_HAS_STRICT */
-#include <sys/timeb.h>
+#include /**/ <sys/timeb.h>
// The following 3 defines are used by the ACE Name Server...
#define ACE_DEFAULT_NAMESPACE_DIR "C:\\temp"
@@ -1032,10 +1032,10 @@ PAGE_NOCACHE */
// This is necessary since MFC users apparently can't #include
// <windows.h> directly.
#if !defined (__AFX_H__)
-#include <windows.h>
+#include /**/ <windows.h>
#endif /* __AFX_H__ */
-#include <winsock.h>
+#include /**/ <winsock.h>
#define MAXHOSTNAMELEN 256
@@ -1081,10 +1081,10 @@ PAGE_NOCACHE */
// #define ENAMETOOLONG WSAENAMETOOLONG
// #define ENOTEMPTY WSAENOTEMPTY
-#include <time.h>
-#include <direct.h>
-#include <process.h>
-#include <io.h>
+#include /**/ <time.h>
+#include /**/ <direct.h>
+#include /**/ <process.h>
+#include /**/ <io.h>
typedef OVERLAPPED ACE_OVERLAPPED;
typedef DWORD ACE_thread_t;
@@ -1336,54 +1336,54 @@ typedef int LPSECURITY_ATTRIBUTES;
#if defined (ACE_HAS_BROKEN_IF_HEADER)
struct ifafilt;
#endif
-#include <sys/socket.h>
+#include /**/ <sys/socket.h>
extern "C" {
#if !defined (VXWORKS)
-#include <netdb.h>
+#include /**/ <netdb.h>
#endif /* VXWORKS */
-#include <net/if.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#include /**/ <net/if.h>
+#include /**/ <netinet/in.h>
+#include /**/ <arpa/inet.h>
}
#if defined (VXWORKS)
-#include <sys/times.h>
+#include /**/ <sys/times.h>
#else
-#include <sys/param.h>
-#include <sys/uio.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/sem.h>
-#include <sys/file.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#include <pwd.h>
+#include /**/ <sys/param.h>
+#include /**/ <sys/uio.h>
+#include /**/ <sys/ipc.h>
+#include /**/ <sys/shm.h>
+#include /**/ <sys/sem.h>
+#include /**/ <sys/file.h>
+#include /**/ <sys/time.h>
+#include /**/ <sys/resource.h>
+#include /**/ <sys/wait.h>
+#include /**/ <pwd.h>
#endif /* VXWORKS */
-#include <sys/ioctl.h>
-#include <dirent.h>
-#include <sys/utsname.h>
-#include <sys/stat.h>
-#include <unistd.h>
+#include /**/ <sys/ioctl.h>
+#include /**/ <dirent.h>
+#include /**/ <sys/utsname.h>
+#include /**/ <sys/stat.h>
+#include /**/ <unistd.h>
#if !defined (ACE_LACKS_PARAM_H)
-#include <sys/param.h>
+#include /**/ <sys/param.h>
#endif /* ACE_LACKS_PARAM_H */
#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) && !defined (VXWORKS)
-#include <sys/un.h>
+#include /**/ <sys/un.h>
#endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */
#if defined (ACE_HAS_SIGINFO_T)
#if !defined (ACE_LACKS_SIGINFO_H)
-#include <siginfo.h>
+#include /**/ <siginfo.h>
#endif /* ACE_LACKS_SIGINFO_H */
#if !defined (ACE_LACKS_UCONTEXT_H)
-#include <ucontext.h>
+#include /**/ <ucontext.h>
#endif /* ACE_LACKS_UCONTEXT_H */
#endif /* ACE_HAS_SIGINFO_T */
#if defined (ACE_HAS_POLL)
-#include <poll.h>
+#include /**/ <poll.h>
#endif /* ACE_HAS_POLL */
#if defined (ACE_HAS_STREAMS)
@@ -1391,10 +1391,10 @@ extern "C" {
#if !defined (_XOPEN_EXTENDED_SOURCE)
#define _XOPEN_EXTENDED_SOURCE
#endif /* !_XOPEN_EXTENDED_SOURCE */
-#include <stropts.h>
+#include /**/ <stropts.h>
#undef _XOPEN_EXTENDED_SOURCE
#else
-#include <stropts.h>
+#include /**/ <stropts.h>
#endif /* AIX */
#endif /* ACE_HAS_STREAMS */
@@ -1407,23 +1407,23 @@ extern "C" int sigwait (sigset_t *set);
#endif /* ACE_HAS_SIGWAIT */
#if defined (ACE_HAS_SELECT_H)
-#include <sys/select.h>
+#include /**/ <sys/select.h>
#endif /* ACE_HAS_SELECT_H */
#if defined (ACE_HAS_ALLOCA_H)
-#include <alloca.h>
+#include /**/ <alloca.h>
#endif /* ACE_HAS_ALLOCA_H */
#if defined (ACE_HAS_TIUSER_H)
-#include <tiuser.h>
+#include /**/ <tiuser.h>
#endif /* ACE_HAS_TIUSER_H */
#if defined (ACE_HAS_SVR4_DYNAMIC_LINKING)
-#include <dlfcn.h>
+#include /**/ <dlfcn.h>
#endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */
#if defined (ACE_HAS_SOCKIO_H)
-#include <sys/sockio.h>
+#include /**/ <sys/sockio.h>
#endif /* ACE_HAS_SOCKIO_ */
// There must be a better way to do this...
@@ -1474,16 +1474,16 @@ extern "C"
// IRIX5 defines bzero() in this odd file...
#if defined (ACE_HAS_BSTRING)
-#include <bstring.h>
+#include /**/ <bstring.h>
#endif /* ACE_HAS_BSTRING */
// AIX defines bzero() in this odd file...
#if defined (ACE_HAS_STRINGS)
-#include <strings.h>
+#include /**/ <strings.h>
#endif /* ACE_HAS_STRINGS */
#if defined (ACE_HAS_TERM_IOCTLS)
-#include <sys/termios.h>
+#include /**/ <sys/termios.h>
#endif /* ACE_HAS_TERM_IOCTLS */
#if defined (ACE_LACKS_MMAP)
@@ -1501,10 +1501,10 @@ extern "C"
#if defined (ACE_HAS_BROKEN_MMAP_H)
extern "C"
{
-#include <sys/mman.h>
+#include /**/ <sys/mman.h>
}
#elif !defined (ACE_LACKS_MMAP)
-#include <sys/mman.h>
+#include /**/ <sys/mman.h>
#endif /* ACE_HAS_BROKEN_MMAP_H */
// OSF1 has problems with sys/msg.h and C++...
@@ -1512,7 +1512,7 @@ extern "C"
#define _KERNEL
#endif /* ACE_HAS_BROKEN_MSG_H */
#if !defined (VXWORKS)
-#include <sys/msg.h>
+#include /**/ <sys/msg.h>
#endif /* VXWORKS */
#if defined (ACE_HAS_BROKEN_MSG_H)
#undef _KERNEL
@@ -1532,11 +1532,11 @@ extern "C"
#if defined (VXWORKS)
#if defined (ACE_HAS_GREENHILLS_SOCKETS)
-#include <hostLib.h>
-#include <ioLib.h>
-#include <selectLib.h>
-#include <sigLib.h>
-#include <sockLib.h>
+#include /**/ <hostLib.h>
+#include /**/ <ioLib.h>
+#include /**/ <selectLib.h>
+#include /**/ <sigLib.h>
+#include /**/ <sockLib.h>
extern "C"
struct sockaddr_un {
@@ -1793,9 +1793,9 @@ typedef int ucontext_t;
#endif /* SA_RESTART */
#if defined (ACE_HAS_TIMOD_H)
-#include <sys/timod.h>
+#include /**/ <sys/timod.h>
#elif defined (ACE_HAS_OSF_TIMOD_H)
-#include <tli/timod.h>
+#include /**/ <tli/timod.h>
#endif /* ACE_HAS_TIMOD_H */
#if defined (ACE_HAS_BROKEN_T_ERRNO)
@@ -1810,7 +1810,7 @@ typedef void (*ACE_Sig_Handler_Ex) (int, siginfo_t *siginfo, ucontext_t *ucontex
// declaration here.
#if defined (ACE_REDEFINES_XTI_FUNCTIONS)
-#include <xti.h>
+#include /**/ <xti.h>
#ifdef UNIXWARE // They apparantly forgot one...
extern "C" int _xti_error(char *);
#endif /* UNIXWARE */
diff --git a/ace/OS.i b/ace/OS.i
index b380aa2d652..98b041ef234 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -52,20 +52,20 @@ typedef char *ACE_MMAP_TYPE;
#endif /* ACE_HAS_VOIDPTR_MMAP */
#if defined (ACE_HAS_XLI)
-#include <xliuser.h>
+#include /**/ <xliuser.h>
#endif /* ACE_HAS_XLI */
#if !defined (ACE_HAS_CPLUSPLUS_HEADERS)
-#include <libc.h>
-#include <osfcn.h>
+#include /**/ <libc.h>
+#include /**/ <osfcn.h>
#endif /* ACE_HAS_CPLUSPLUS_HEADERS */
#if defined (ACE_HAS_SYSENT_H)
-#include <sysent.h>
+#include /**/ <sysent.h>
#endif /* ACE_HAS_SYSENT_H_*/
#if defined (ACE_HAS_SYS_FILIO_H)
-#include <sys/filio.h>
+#include /**/ <sys/filio.h>
#endif /* ACE_HAS_SYS_FILIO_H */
#if defined (ACE_HAS_SVR4_GETTIMEOFDAY)
@@ -93,25 +93,25 @@ typedef const struct timespec * ACE_TIMESPEC_PTR;
#endif /* HPUX */
#if !defined (ACE_LACKS_MALLOC_H)
-#include <malloc.h>
+#include /**/ <malloc.h>
#endif /* ACE_LACKS_MALLOC_H */
#if !defined (ACE_WIN32)
#if !defined (ACE_LACKS_RPC_H)
-#include <rpc/rpc.h>
+#include /**/ <rpc/rpc.h>
#endif /* ACE_LACKS_RPC_H */
// Matthew Stevens 7-10-95 Fix GNU GCC 2.7 for memchr() problem.
#if defined (ACE_HAS_GNU_CSTRING_H)
// Define this file to keep /usr/include/memory.h from being included.
-#include <cstring>
+#include /**/ <cstring>
#else
#if defined (VXWORKS)
-#include <string.h>
+#include /**/ <string.h>
#else
-#include <memory.h>
+#include /**/ <memory.h>
#endif /* VXWORKS */
#endif /* ACE_HAS_GNU_CSTRING_H */
@@ -135,19 +135,19 @@ extern "C" char *mktemp (char *);
// inlining...
#if defined (ACE_HAS_REGEX)
-#include <regexpr.h>
+#include /**/ <regexpr.h>
#endif /* ACE_HAS_REGEX */
#if defined (ACE_HAS_SYSINFO)
-#include <sys/systeminfo.h>
+#include /**/ <sys/systeminfo.h>
#endif /* ACE_HAS_SYS_INFO */
#if defined (ACE_HAS_SYSCALL_H)
-#include <sys/syscall.h>
+#include /**/ <sys/syscall.h>
#endif /* ACE_HAS_SYSCALL_H */
#if defined (UNIXWARE) // See strcasecmp, below
-#include <ctype.h>
+#include /**/ <ctype.h>
#endif /* UNIXWARE */
// Adapt the weird threading and synchronization routines (which don't
diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp
index abb765b6997..ea1fc251fd2 100644
--- a/ace/Proactor.cpp
+++ b/ace/Proactor.cpp
@@ -328,13 +328,13 @@ ACE_Proactor::dispatch (ACE_Overlapped_IO *overlapped,
overlapped->re_init ();
return this->initiate (overlapped);
case -1: // Handler is closing.
- overlapped->handler_->
- handle_close (overlapped->handler_->get_handle (),
- overlapped->mask_);
+ overlapped->handler_->handle_close
+ (overlapped->handler_->get_handle (), overlapped->mask_);
// Fallthrough.
default:
// Handler succeeded, but does not want another operation
// started.
+
delete overlapped;
return 0;
}
@@ -360,6 +360,8 @@ ACE_Proactor::initiate (ACE_Event_Handler *handler,
file, this->global_handle_),
-1);
+ // Tell the handler that *this* <Proactor> is dispatching it.
+ handler->proactor (this);
return this->initiate (overlapped);
}
diff --git a/ace/Proactor.h b/ace/Proactor.h
index 8fb845b0f3e..7801305b10d 100644
--- a/ace/Proactor.h
+++ b/ace/Proactor.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/README b/ace/README
index db72c29959d..2faf0ba6c2f 100644
--- a/ace/README
+++ b/ace/README
@@ -100,6 +100,7 @@ ACE_HAS_SYSCALL_H Compiler/platform contains the <sys/syscall.h> file.
ACE_HAS_SYSENT_H Platform provides <sysent.h> header
ACE_HAS_SYSINFO Platform supports system configuration information
ACE_HAS_SYSV_IPC Platform supports System V IPC (most versions of UNIX, but not Win32)
+ACE_HAS_SYSV_SPRINTF Platform/compiler support the System V sprintf().
ACE_HAS_SYS_ERRLIST Platform/compiler supports _sys_errlist symbol
ACE_HAS_SYS_FILIO_H Platform provides <sys/filio.h> header
ACE_HAS_SYS_SIGLIST Compiler/platform supports sys_siglist array
@@ -157,7 +158,7 @@ ACE_MT_SAFE Compile using multi-thread libraries
ACE_NDEBUG Turns off debugging features
ACE_NEEDS_HUGE_THREAD_STACKSIZE Required by platforms with small default stacks.
ACE_NEEDS_READV Platform doesn't define readv, so use our own
-ACE_NEEDS_SYSTIME_H <time.h> doesn't automatically #include <sys/time.h>
+ACE_NEEDS_SYSTIME_H <time.h> doesn't automatically #include /**/ <sys/time.h>
ACE_NEEDS_WRITEV Platform doesn't define writev, so use our own
ACE_NLOGGING Turns off the LM_DEBUG and LM_ERROR logging macros...
ACE_NTRACE Turns off the tracing feature.
@@ -572,7 +573,7 @@ ACE_HAS_POLL:
Notes:
#if defined (ACE_HAS_POLL)
- #include <poll.h>
+ #include /**/ <poll.h>
#endif /* ACE_HAS_POLL */
ACE_USE_POLL_IMPLEMENTATION:
diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp
index b0a618b7f25..214ed466c93 100644
--- a/ace/Reactor.cpp
+++ b/ace/Reactor.cpp
@@ -758,8 +758,8 @@ ACE_Reactor::register_handler (ACE_Event_Handler *handler,
int
ACE_Reactor::register_handler (ACE_HANDLE handle,
- ACE_Event_Handler *handler,
- ACE_Reactor_Mask mask)
+ ACE_Event_Handler *handler,
+ ACE_Reactor_Mask mask)
{
ACE_TRACE ("ACE_Reactor::register_handler");
ACE_MT (ACE_GUARD_RETURN (ACE_REACTOR_MUTEX, ace_mon, this->token_, -1));
@@ -1278,6 +1278,9 @@ ACE_Reactor::attach (ACE_HANDLE handle,
this->wr_handle_mask_,
this->ex_handle_mask_,
ACE_Reactor::ADD_MASK);
+
+ // Assign *this* <Reactor> to the <Event_Handler>.
+ handler->reactor (this);
return 0;
}
@@ -1306,6 +1309,8 @@ ACE_Reactor::detach (ACE_HANDLE handle,
this->rd_handle_mask_,
this->wr_handle_mask_,
this->ex_handle_mask_);
+ // Reinitialize the Reactor pointer to 0.
+ eh->reactor (0);
return 0;
}
diff --git a/ace/ReactorEx.cpp b/ace/ReactorEx.cpp
index a8a2c9eb3c1..a375c073e66 100644
--- a/ace/ReactorEx.cpp
+++ b/ace/ReactorEx.cpp
@@ -45,11 +45,14 @@ ACE_ReactorEx::register_handler (ACE_Event_Handler *eh,
this->handles_[this->active_handles_] = handle;
this->handlers_[this->active_handles_] = eh;
this->active_handles_++;
+
+ // Assign *this* <ReactorEx> to the <Event_Handler>.
+ eh->reactorex (this);
return 0;
}
-// Removes -eh- from the ReactorEx. Note that the ReactorEx will call
-// eh->get_handle() to extract the underlying I/O handle.
+// Removes <eh> from the <ReactorEx>. Note that the <ReactorEx> will
+// call eh->get_handle() to extract the underlying I/O handle.
int
ACE_ReactorEx::remove_handler (ACE_Event_Handler *eh,
@@ -59,8 +62,8 @@ ACE_ReactorEx::remove_handler (ACE_Event_Handler *eh,
ACE_HANDLE handle = eh->get_handle ();
- // Go through all the handles looking for -handle-. Even if we find
- // it, we continue through the rest of the list. -handle- could
+ // Go through all the handles looking for <handle>. Even if we find
+ // it, we continue through the rest of the list. <handle> could
// appear multiple times.
for (size_t index = 0; index < this->active_handles_; index++)
{
@@ -70,6 +73,9 @@ ACE_ReactorEx::remove_handler (ACE_Event_Handler *eh,
handlers_[index]->handle_close (handle,
ACE_Event_Handler::NULL_MASK);
+ // Reinitial the ReactorEx pointer since we no longer point
+ // to this one.
+ handlers_[index]->reactorex (0);
// If there was only one handle, reset the pointer to 0.
if (this->active_handles_ == 1)
{
diff --git a/ace/SString.cpp b/ace/SString.cpp
index a32237cdbab..8b12fd98f90 100644
--- a/ace/SString.cpp
+++ b/ace/SString.cpp
@@ -79,15 +79,16 @@ ACE_CString::ACE_CString (const char *s, ACE_Allocator *alloc)
{
this->len_ = ACE_OS::strlen (s);
this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1);
- ACE_OS::strcpy (this->rep_, s);
+ ACE_OS::memcpy (this->rep_, s, this->len_);
+ this->rep_[this->len_] = '\0';
}
}
// Constructor that actually copies memory.
ACE_CString::ACE_CString (const char *s,
- size_t len,
- ACE_Allocator *alloc)
+ size_t len,
+ ACE_Allocator *alloc)
: allocator_ (alloc)
{
ACE_TRACE ("ACE_CString::ACE_CString");
@@ -104,7 +105,7 @@ ACE_CString::ACE_CString (const char *s,
{
this->len_ = len;
this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1);
- ACE_OS::strncpy (this->rep_, s, len);
+ ACE_OS::memcpy (this->rep_, s, len);
this->rep_[len] = '\0'; // Make sure to NUL terminate this!
}
}
@@ -207,7 +208,7 @@ ACE_SString::ACE_SString (const ACE_SString &s)
this->rep_ = (char *) this->allocator_->malloc (s.len_ + 1);
ACE_OS::memcpy ((void *) this->rep_, (const void *) s.rep_, this->len_);
- this->rep_[this->len_] = 0;
+ this->rep_[this->len_] = '\0';
}
// Default constructor.
@@ -319,7 +320,7 @@ ACE_SString::ACE_SString (const char *s,
{
this->len_ = len;
this->rep_ = (char *) this->allocator_->malloc (this->len_ + 1);
- ACE_OS::strncpy (this->rep_, s, len);
+ ACE_OS::memcpy (this->rep_, s, len);
this->rep_[len] = '\0'; // Make sure to NUL terminate this!
}
}
diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp
index 9e32df1d7e1..1b231422402 100644
--- a/ace/Service_Config.cpp
+++ b/ace/Service_Config.cpp
@@ -33,81 +33,69 @@ ACE_Service_Config::dump (void) const
ACE_SVC_FACTORY_DEFINE (ACE_Service_Manager)
// ----------------------------------------
+
+// Set the signal handler to point to the handle_signal() function.
+ACE_Sig_Adapter ACE_Service_Config::signal_handler_ (&ACE_Service_Config::handle_signal);
+
// Process-wide Service Repository.
-/* static */
ACE_Service_Repository *ACE_Service_Config::svc_rep_ = 0;
// Controls whether the Service_Repository is deleted when we shut
// down (we can only delete it safely if we created it!)
-/* static */
int ACE_Service_Config::delete_svc_rep_ = 0;
// Process-wide Thread Manager.
-/* static */
ACE_Thread_Manager *ACE_Service_Config::thr_mgr_ = 0;
// Controls whether the Thread_Manager is deleted when we shut down
// (we can only delete it safely if we created it!)
-/* static */
int ACE_Service_Config::delete_thr_mgr_ = 0;
// Process-wide ACE_Allocator.
-/* static */
ACE_Allocator *ACE_Service_Config::allocator_ = 0;
// Controls whether the Allocator is deleted when we shut down (we can
// only delete it safely if we created it!)
-/* static */
int ACE_Service_Config::delete_allocator_ = 0;
// Process-wide ACE_Proactor.
-/* static */
ACE_Proactor *ACE_Service_Config::proactor_ = 0;
// Controls whether the Proactor is deleted when we shut down (we can
// only delete it safely if we created it!)
-/* static */
int ACE_Service_Config::delete_proactor_ = 0;
// Process-wide ACE_Reactor.
-/* static */
ACE_Reactor *ACE_Service_Config::reactor_ = 0;
// Controls whether the Reactor is deleted when we shut down (we can
// only delete it safely if we created it!)
-/* static */
int ACE_Service_Config::delete_reactor_ = 0;
// Process-wide ACE_ReactorEx.
-/* static */
ACE_ReactorEx *ACE_Service_Config::reactorEx_ = 0;
// Controls whether the ReactorEx is deleted when we shut down (we can
// only delete it safely if we created it!)
-/* static */
int ACE_Service_Config::delete_reactorEx_ = 0;
// Make this the default.
typedef ACE_Malloc <ACE_LOCAL_MEMORY_POOL, ACE_Null_Mutex> ACE_DEFAULT_MALLOC;
// Terminate the eventloop.
-/* static */
sig_atomic_t ACE_Service_Config::end_reactor_event_loop_ = 0;
sig_atomic_t ACE_Service_Config::end_proactor_event_loop_ = 0;
sig_atomic_t ACE_Service_Config::end_reactorEx_event_loop_ = 0;
// Trigger a reconfiguration.
-/* static */
sig_atomic_t ACE_Service_Config::reconfig_occurred_ = 0;
// = Set by command-line options.
-/* static */
char ACE_Service_Config::debug_ = 0;
char ACE_Service_Config::be_a_daemon_ = 0;
char ACE_Service_Config::no_defaults_ = 0;
// Number of the signal used to trigger reconfiguration.
-/* static */
int ACE_Service_Config::signum_ = SIGHUP;
// Name of the service configuration file.
@@ -371,7 +359,8 @@ ACE_Service_Config::ACE_Service_Config (int ignore_defaults,
// This really ought to be a Singleton I suspect...
if (ACE_Service_Config::reactor_->register_handler
- (ACE_Service_Config::signum_, this) == -1)
+ (ACE_Service_Config::signum_,
+ &ACE_Service_Config::signal_handler_) == -1)
ACE_ERROR ((LM_ERROR, "can't register signal handler\n"));
#endif /* !ACE_WIN32 */
}
@@ -405,16 +394,11 @@ ACE_Service_Config::parse_args (int argc, char *argv[])
// There's no point in dealing with this on NT since it doesn't really
// support signals very well...
#if !defined (ACE_WIN32)
- ACE_Event_Handler *eh = 0;
-
- if (ACE_Service_Config::reactor ()->handler
- (ACE_Service_Config::signum_, &eh) == -1)
- ACE_ERROR ((LM_ERROR, "cannot obtain signal handler\n"));
-
ACE_Service_Config::signum_ = ACE_OS::atoi (getopt.optarg);
if (ACE_Service_Config::reactor ()->register_handler
- (ACE_Service_Config::signum_, eh) == -1)
+ (ACE_Service_Config::signum_,
+ &ACE_Service_Config::signal_handler_) == -1)
ACE_ERROR ((LM_ERROR, "cannot obtain signal handler\n"));
#endif /* !ACE_WIN32 */
break;
@@ -609,7 +593,7 @@ ACE_Service_Config::ACE_Service_Config (const char program_name[])
// Signal handling API to trigger dynamic reconfiguration.
-int
+void
ACE_Service_Config::handle_signal (int sig, siginfo_t *, ucontext_t *)
{
ACE_TRACE ("ACE_Service_Config::handle_signal");
@@ -623,7 +607,6 @@ ACE_Service_Config::handle_signal (int sig, siginfo_t *, ucontext_t *)
ACE_DEBUG ((LM_DEBUG, "signal %S occurred\n", sig));
ACE_Service_Config::reconfig_occurred_ = 1;
- return 0;
}
// Trigger the reconfiguration process.
diff --git a/ace/Service_Config.h b/ace/Service_Config.h
index 8e0341ff1ce..a0389f40c57 100644
--- a/ace/Service_Config.h
+++ b/ace/Service_Config.h
@@ -64,14 +64,10 @@ public:
typedef ACE_Unbounded_Set<ACE_Static_Svc_Descriptor *> ACE_STATIC_SVCS;
typedef ACE_Unbounded_Set_Iterator<ACE_Static_Svc_Descriptor *> ACE_STATIC_SVCS_ITERATOR;
-class ACE_Export ACE_Service_Config : public ACE_Event_Handler
+class ACE_Export ACE_Service_Config
// = TITLE
- // Provide the base class that supplies common server daemon
- // operations.
- //
- // = DESCRIPTION
- // This class inherits from <ACE_Event_Handler> so that it can
- // be used as a signal handler.
+ // Supplies common server operations for dynamic and static
+ // configuration of services.
{
public:
enum {MAX_SERVICES = ACE_DEFAULT_REACTOR_SIZE};
@@ -272,11 +268,10 @@ protected:
static int load_defaults (void);
// Add the default statically-linked services to the <ACE_Service_Repository>.
- virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0);
- // Signal handling API to trigger dynamic reconfiguration.
+ static void handle_signal (int sig, siginfo_t *, ucontext_t *);
+ // Handles signals to trigger reconfigurations.
private:
-
static ACE_Service_Repository *svc_rep_;
// Pointer to a process-wide <ACE_Service_Repository>.
@@ -341,6 +336,9 @@ private:
static int signum_;
// Number of the signal used to trigger reconfiguration.
+
+ static ACE_Sig_Adapter signal_handler_;
+ // Handles the reconfiguration signals.
};
#if defined (__ACE_INLINE__)
diff --git a/ace/Signal.h b/ace/Signal.h
index 9396ac8c807..e12b18fdc1e 100644
--- a/ace/Signal.h
+++ b/ace/Signal.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
diff --git a/ace/Stack.cpp b/ace/Stack.cpp
index 4f2a642244e..f23407a52ef 100644
--- a/ace/Stack.cpp
+++ b/ace/Stack.cpp
@@ -390,12 +390,12 @@ ACE_Unbounded_Queue<TYPE>::enqueue (const TYPE &new_item)
if (temp == 0)
return -1;
- if (head_ == 0)
- head_ = tail_ = temp;
+ if (this->head_ == 0)
+ this->head_ = this->tail_ = temp;
else
{
- tail_->next_ = temp;
- tail_ = temp;
+ this->tail_->next_ = temp;
+ this->tail_ = temp;
}
++this->cur_size_;
@@ -404,16 +404,28 @@ ACE_Unbounded_Queue<TYPE>::enqueue (const TYPE &new_item)
}
template <class TYPE> int
+ACE_Unbounded_Queue<TYPE>::peek (TYPE &item)
+{
+ ACE_TRACE ("ACE_Unbounded_Queue<TYPE>::peek (TYPE *&item)");
+
+ if (this->head_ == 0)
+ return -1;
+
+ item = this->head_->item_;
+ return 0;
+}
+
+template <class TYPE> int
ACE_Unbounded_Queue<TYPE>::dequeue (TYPE &item)
{
ACE_TRACE ("ACE_Unbounded_Queue<TYPE>::dequeue (TYPE *&item)");
- if (head_ == 0)
+ if (this->head_ == 0)
return -1;
- item = head_->item_;
- ACE_Queue_Node<TYPE> *temp = head_;
- head_ = head_->next_;
+ item = this->head_->item_;
+ ACE_Queue_Node<TYPE> *temp = this->head_;
+ this->head_ = this->head_->next_;
delete temp;
--this->cur_size_;
return 0;
diff --git a/ace/Stack.h b/ace/Stack.h
index 6b7e9ad7ed8..3b8e85a6ecd 100644
--- a/ace/Stack.h
+++ b/ace/Stack.h
@@ -240,9 +240,14 @@ public:
// construction.
int enqueue (const TYPE &new_item);
- // Returns 0 on success -1 on failure.
+ // Addes <new_item> to the queue. Returns 0 on success -1 on failure.
int dequeue (TYPE &item);
+ // Removes and returns the first <item> on the queue. Returns 0 on
+ // success -1 if nothing was found.
+
+ int peek (TYPE &item);
+ // Returns the first <item> on the queue without removing it.
// Returns 0 on success -1 if nothing was found.
int size (void) const;
diff --git a/ace/Svc_Conf_l.cpp b/ace/Svc_Conf_l.cpp
index 99f64f26b71..9495714f23a 100644
--- a/ace/Svc_Conf_l.cpp
+++ b/ace/Svc_Conf_l.cpp
@@ -12,7 +12,7 @@
#if defined (HPUX) || defined (VXWORKS)
#include "ace/OS.h"
#endif /* HPUX || VXWORKS */
-#include <stdio.h>
+#include /**/ <stdio.h>
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
@@ -25,8 +25,8 @@
#ifdef __cplusplus
-#include <stdlib.h>
-#include <stdio.h>
+#include /**/ <stdlib.h>
+#include /**/ <stdio.h>
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
@@ -482,7 +482,7 @@ YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
-#include <stdlib.h>
+#include /**/ <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines. This will fail
diff --git a/ace/Svc_Handler.cpp b/ace/Svc_Handler.cpp
index 4c7261fcb70..f2044a8b05a 100644
--- a/ace/Svc_Handler.cpp
+++ b/ace/Svc_Handler.cpp
@@ -87,11 +87,12 @@ template <PR_ST_1, ACE_SYNCH_1>
ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::ACE_Svc_Handler (ACE_Thread_Manager *tm,
ACE_Message_Queue<ACE_SYNCH_2> *mq,
ACE_Reactor *reactor)
- : ACE_Task<ACE_SYNCH_2> (tm, mq),
- reactor_ (reactor)
+ : ACE_Task<ACE_SYNCH_2> (tm, mq)
{
ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::ACE_Svc_Handler");
+ this->reactor (reactor);
+
// This clever idiom transparently checks if we were allocated
// dynamically. This information is used by the <destroy> method to
// decide if we need to delete <this>... The idiom is based on a
@@ -123,9 +124,9 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::open (void *)
ACE_DEBUG ((LM_DEBUG, "connected to %s on fd %d\n",
buf, this->peer_.get_handle ()));
#endif /* DEBUGGING */
- if (this->reactor_
- && this->reactor_->register_handler (this,
- ACE_Event_Handler::READ_MASK) == -1)
+ if (this->reactor ()
+ && this->reactor ()->register_handler (this,
+ ACE_Event_Handler::READ_MASK) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "%p",
"unable to register client handler"), -1);
return 0;
@@ -138,39 +139,22 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::shutdown (void)
{
ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::shutdown");
// Deregister this handler with the ACE_Reactor.
- if (this->reactor_)
+ if (this->reactor ())
{
ACE_Reactor_Mask mask = ACE_Event_Handler::WRITE_MASK |
ACE_Event_Handler::READ_MASK |
ACE_Event_Handler::DONT_CALL;
- // Remove self from reactor.
- this->reactor_->remove_handler (this, mask);
-
// Make sure there are no timers.
- this->reactor_->cancel_timer( this );
+ this->reactor ()->cancel_timer( this );
- // Note the fact that the Reactor has shut down.
- this->reactor_ = 0;
+ // Remove self from reactor.
+ this->reactor ()->remove_handler (this, mask);
}
this->peer ().close ();
}
-template <PR_ST_1, ACE_SYNCH_1> ACE_Reactor *
-ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::reactor (void) const
-{
- ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::reactor");
- return this->reactor_;
-}
-
-template <PR_ST_1, ACE_SYNCH_1> void
-ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::reactor (ACE_Reactor *r)
-{
- ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::reactor");
- this->reactor_ = r;
-}
-
template <PR_ST_1, ACE_SYNCH_1> void
ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_2>::dump (void) const
{
diff --git a/ace/Svc_Handler.h b/ace/Svc_Handler.h
index bf10408b5ce..b66aa783ebd 100644
--- a/ace/Svc_Handler.h
+++ b/ace/Svc_Handler.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
@@ -101,12 +100,6 @@ public:
virtual int put (ACE_Message_Block *, ACE_Time_Value *tv = 0);
// Provide a default implementation to simplify ancestors...
- ACE_Reactor *reactor (void) const;
- // Get the underlying Reactor *.
-
- void reactor (ACE_Reactor *);
- // Set the underlying Reactor *.
-
virtual void destroy (void);
// Call this instead of <delete> to free up dynamically allocated
// <Svc_Handler>. This method knows whether or not the object was
@@ -136,9 +129,6 @@ private:
ACE_PEER_STREAM peer_;
// Maintain connection with client.
- ACE_Reactor *reactor_;
- // Event demultiplex associated with this object.
-
static ACE_Dynamic *instance (void);
// Point of access to the singleton.
diff --git a/ace/Task_T.h b/ace/Task_T.h
index e65f2e9b979..d3ede819283 100644
--- a/ace/Task_T.h
+++ b/ace/Task_T.h
@@ -1,3 +1,6 @@
+/* -*- C++ -*- */
+// $Id$
+
// ============================================================================
//
// = LIBRARY
@@ -67,7 +70,7 @@ public: // Should be protected:
// Tests whether we can enqueue a message without blocking.
int reply (ACE_Message_Block *, ACE_Time_Value *tv = 0);
- // Turn the message back around.
+ // Turn the message around and send it back down the Stream.
int put_next (ACE_Message_Block *msg, ACE_Time_Value *tv = 0);
// Transfer message to the adjacent ACE_Task in a ACE_Stream.
diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp
index 8701b50b532..388f83f1a9f 100644
--- a/ace/Thread_Manager.cpp
+++ b/ace/Thread_Manager.cpp
@@ -296,7 +296,7 @@ ACE_Thread_Manager::spawn_n (ACE_thread_t thread_ids[],
if (grp_id == -1)
grp_id = this->grp_id_++; // Increment the group id.
- for (int i = 0; i < n; i++)
+ for (size_t i = 0; i < n; i++)
{
// @@ What should happen if this fails?! e.g., should we try to
// cancel the other threads that we've already spawned or what?
diff --git a/ace/Time_Value.h b/ace/Time_Value.h
index e4cdb1223ae..ec2d5aebabf 100644
--- a/ace/Time_Value.h
+++ b/ace/Time_Value.h
@@ -75,7 +75,7 @@
// Just to be safe we'll do it with pthreads, too -- jwr
#if defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS)
extern "C" {
-#include <pthread.h>
+#include /**/ <pthread.h>
#if defined (DIGITAL_UNIX)
#define pthread_self __pthread_self
extern "C" pthread_t pthread_self (void);
@@ -89,14 +89,14 @@ extern "C" pthread_t pthread_self (void);
#define ACE_TRACE(X) ACE_Trace ____ (X, __LINE__, __FILE__)
#endif /* ACE_NTRACE */
-#include <time.h>
+#include /**/ <time.h>
#if defined (ACE_NEEDS_SYSTIME_H)
// Some platforms may need to include this, but I suspect that most
// will get it from <time.h>
#if defined (VXWORKS)
-#include <sys/times.h>
+#include /**/ <sys/times.h>
#else
-#include <sys/time.h>
+#include /**/ <sys/time.h>
#endif /* VXWORKS */
#endif /* ACE_NEEDS_SYSTIME_H */
@@ -109,7 +109,7 @@ typedef struct timespec
} timespec_t;
#elif defined (ACE_HAS_BROKEN_POSIX_TIME)
// OSF/1 defines struct timespec in <sys/timers.h> - Tom Marrs
-#include <sys/timers.h>
+#include /**/ <sys/timers.h>
#endif /* ACE_HAS_POSIX_TIME */
// #if (!defined (timespec) && !defined (m88k))
diff --git a/ace/XtReactor.h b/ace/XtReactor.h
index c26bf0677d6..7ba58b88867 100644
--- a/ace/XtReactor.h
+++ b/ace/XtReactor.h
@@ -23,7 +23,7 @@
#if defined (ACE_HAS_XT)
#define String XtString
-#include <X11/Intrinsic.h>
+#include /**/ <X11/Intrinsic.h>
#undef String
// Forward decl.
diff --git a/ace/config-hpux-10.x.h b/ace/config-hpux-10.x.h
index 650e4e70495..ce0578b38ed 100644
--- a/ace/config-hpux-10.x.h
+++ b/ace/config-hpux-10.x.h
@@ -14,8 +14,8 @@
#endif /* HPUX */
#define _HPUX_SOURCE
-#include <sys/stdsyms.h>
-#include <sched.h> // pthread.h doesn't include this
+#include /**/ <sys/stdsyms.h>
+#include /**/ <sched.h> // pthread.h doesn't include this
#define ACE_HAS_BROKEN_CONVERSIONS
diff --git a/ace/config-irix6.2-sgic++.h b/ace/config-irix6.2-sgic++.h
index db80b336940..c35f452cb17 100644
--- a/ace/config-irix6.2-sgic++.h
+++ b/ace/config-irix6.2-sgic++.h
@@ -16,8 +16,8 @@
#define ACE_HAS_IRIX62_THREADS
// Needed for the threading stuff?
-#include <sched.h>
-#include <task.h>
+#include /**/ <sched.h>
+#include /**/ <task.h>
#define PTHREAD_MIN_PRIORITY PX_PRIO_MIN
#define PTHREAD_MAX_PRIORITY PX_PRIO_MAX
diff --git a/ace/config-linux-pthread.h b/ace/config-linux-pthread.h
index 942510e4a17..1b43cbbe68f 100644
--- a/ace/config-linux-pthread.h
+++ b/ace/config-linux-pthread.h
@@ -94,6 +94,6 @@
// To use pthreads on Linux you'll need to use the MIT version, for
// now...
#define _MIT_POSIX_THREADS 1
-#include <pthread/mit/pthread.h>
+#include /**/ <pthread/mit/pthread.h>
#endif /* ACE_CONFIG_H */
diff --git a/ace/config-sunos4-sun3.x.h b/ace/config-sunos4-sun3.x.h
index 62e63a6098e..c811480cbea 100644
--- a/ace/config-sunos4-sun3.x.h
+++ b/ace/config-sunos4-sun3.x.h
@@ -1,10 +1,15 @@
/* -*- C++ -*- */
// $Id$
-// The following configuration file is designed to work
-// for SunOS4 platforms using the SunC++ 3.0.x compiler.
+// The following configuration file is designed to work for SunOS4
+// platforms using the SunC++ 3.0.x compiler.
#if !defined (ACE_CONFIG_H)
+#define ACE_LACKS_POSIX_PROTO
+#define ACE_HAS_UNION_WAIT
+#define ACE_HAS_SPARCWORKS_401_SIGNALS
+#define ACE_HAS_SYSV_SPRINTF
+
#define ACE_CONFIG_H
#define ACE_HAS_SYS_ERRLIST
diff --git a/ace/config-vxworks-ghs-1.8.h b/ace/config-vxworks-ghs-1.8.h
index a6439901301..e478198fe2c 100644
--- a/ace/config-vxworks-ghs-1.8.h
+++ b/ace/config-vxworks-ghs-1.8.h
@@ -48,8 +48,8 @@
typedef int key_t;
// GreenHills 1.8.8 needs the stdarg.h #include early: it shouldn't
// hurt other compilers.
-#include <stdarg.h>
-#include <vxWorks.h>
+#include /**/ <stdarg.h>
+#include /**/ <vxWorks.h>
#endif /* ACE_CONFIG_H */
diff --git a/ace/config-vxworks5.2-g++.h b/ace/config-vxworks5.2-g++.h
index 78f13da0050..3922136e172 100644
--- a/ace/config-vxworks5.2-g++.h
+++ b/ace/config-vxworks5.2-g++.h
@@ -54,7 +54,7 @@
// defined early also: these are here
// because Time_Value.h #includes ace/config.h, but not ace/OS.h
typedef int key_t;
-#include <vxWorks.h>
+#include /**/ <vxWorks.h>
#endif /* ACE_CONFIG_H */
diff --git a/ace/config-win32-msvc2.0.h b/ace/config-win32-msvc2.0.h
index 724cc6243fb..8bfd4740aa0 100644
--- a/ace/config-win32-msvc2.0.h
+++ b/ace/config-win32-msvc2.0.h
@@ -8,7 +8,7 @@
#define ACE_CONFIG_H
// Needed for timeval.
-#include <winsock.h>
+#include /**/ <winsock.h>
#define ACE_HAS_UNICODE
diff --git a/ace/config-win32-msvc4.0.h b/ace/config-win32-msvc4.0.h
index f8f35f07c5c..e6c49c327bd 100644
--- a/ace/config-win32-msvc4.0.h
+++ b/ace/config-win32-msvc4.0.h
@@ -31,20 +31,20 @@
// trl 26-July-1996
#ifdef _AFXDLL // May be defined by MSVC++ IDE
-#include <afxwin.h> // He is doing MFC
+#include /**/ <afxwin.h> // He is doing MFC
#define _INC_WINDOWS // Prevent winsock.h from including windows.h
#endif
#ifdef _WINDLL // May be defined by MSVC++ IDE
-#include <afxwin.h> // He is doing MFC
+#include /**/ <afxwin.h> // He is doing MFC
#define _INC_WINDOWS // Prevent winsock.h from including windows.h
#endif
#ifndef __AFX_H__ // set in afxwin.h
-#include <windows.h> // if he's not doing MFC, snag this
+#include /**/ <windows.h> // if he's not doing MFC, snag this
#endif
// Needed for timeval.
-#include <winsock.h>
+#include /**/ <winsock.h>
#define ACE_HAS_UNICODE
#define ACE_HAS_STL
diff --git a/ace/stdcpp.h b/ace/stdcpp.h
index 35729cf98f1..a1542fedac7 100644
--- a/ace/stdcpp.h
+++ b/ace/stdcpp.h
@@ -25,24 +25,24 @@
#if defined (ACE_HAS_STANDARD_CPP_LIBRARY)
// For some reason, The Standard C++ Library has decided to save space
// and ommit the file extensions.
-#include <iomanip>
-#include <ios>
-#include <iostream>
-#include <istream>
-#include <ostream>
-#include <streambuf>
+#include /**/ <iomanip>
+#include /**/ <ios>
+#include /**/ <iostream>
+#include /**/ <istream>
+#include /**/ <ostream>
+#include /**/ <streambuf>
#else /* ACE_HAS_STANDARD_CPP_LIBRARY */
-#include <fstream.h>
-#include <iomanip.h>
-#include <ios.h>
-#include <iostream.h>
-#include <istream.h>
-#include <ostream.h>
-#include <streamb.h>
-#include <strstrea.h>
+#include /**/ <fstream.h>
+#include /**/ <iomanip.h>
+#include /**/ <ios.h>
+#include /**/ <iostream.h>
+#include /**/ <istream.h>
+#include /**/ <ostream.h>
+#include /**/ <streamb.h>
+#include /**/ <strstrea.h>
#endif /* ACE_HAS_STANDARD_CPP_LIBRARY */
#else /* ACE_WIN32 */
// All platforms except for NT include iostream.h.
-#include <iostream.h>
+#include /**/ <iostream.h>
#endif /* ACE_WIN32 */