diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-09-08 00:16:44 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-09-08 00:16:44 +0000 |
commit | 2b05f68c8ceef93fea99d6eb440c0635a19605f6 (patch) | |
tree | 1312938a9bf295863248691d500c302657cb8501 | |
parent | cb005c95c0eeaa92aac5c9be6e4f88decd0a8766 (diff) | |
download | ATCD-2b05f68c8ceef93fea99d6eb440c0635a19605f6.tar.gz |
ChangeLogTag:Thu Sep 7 16:15:24 2000 Carlos O'Ryan <coryan@uci.edu>
-rw-r--r-- | ChangeLog | 52 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 52 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 52 | ||||
-rw-r--r-- | ace/Base_Thread_Adapter.cpp | 130 | ||||
-rw-r--r-- | ace/Base_Thread_Adapter.h | 164 | ||||
-rw-r--r-- | ace/Base_Thread_Adapter.inl | 22 | ||||
-rw-r--r-- | ace/Log_Msg.cpp | 13 | ||||
-rw-r--r-- | ace/Log_Msg.h | 3 | ||||
-rw-r--r-- | ace/Makefile | 915 | ||||
-rw-r--r-- | ace/Makefile.am | 4 | ||||
-rw-r--r-- | ace/Makefile.bor | 2 | ||||
-rw-r--r-- | ace/OS.cpp | 114 | ||||
-rw-r--r-- | ace/OS.h | 19 | ||||
-rw-r--r-- | ace/OS_Thread_Adapter.cpp | 178 | ||||
-rw-r--r-- | ace/OS_Thread_Adapter.h | 78 | ||||
-rw-r--r-- | ace/OS_Thread_Adapter.inl | 1 | ||||
-rw-r--r-- | ace/Thread.h | 1 | ||||
-rw-r--r-- | ace/Thread_Adapter.cpp | 49 | ||||
-rw-r--r-- | ace/Thread_Adapter.h | 87 | ||||
-rw-r--r-- | ace/Thread_Adapter.inl | 24 | ||||
-rw-r--r-- | ace/Thread_Hook.cpp | 2 | ||||
-rw-r--r-- | ace/Thread_Hook.h | 4 | ||||
-rw-r--r-- | ace/ace-lib.icc | 3 | ||||
-rwxr-xr-x | ace/ace.icc | 2 | ||||
-rw-r--r-- | ace/config-all.h | 17 |
25 files changed, 1443 insertions, 545 deletions
diff --git a/ChangeLog b/ChangeLog index d185bc235aa..48b411a7428 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,55 @@ +Thu Sep 7 16:15:24 2000 Carlos O'Ryan <coryan@uci.edu> + + * ace/OS.h: + * ace/OS.cpp: + Break out the dependency between the ACE_Thread_Manager and the + OS layer. The OS layer used ACE_Thread_Adapter to create + threads, this class depends on ACE_Thread_Manager, but on the + path used by the OS layer the class does not use Thread_Manager + at all. The solution was to create a base class + (ACE_Base_Thread_Adapter) and a specialized version used in the + OS layer (ACE_OS_Thread_Adapter). + + * ace/Makefile: + * ace/Makefile.am: + * ace/Makefile.bor: + Update the Makefile and the dependencies. + + * ace/Base_Thread_Adapter.h: + * ace/Base_Thread_Adapter.inl: + * ace/Base_Thread_Adapter.cpp: + Abstract base class for ACE_Thread_Adapter. Applications + continue to use ACE_Thread_Adapter, but the OS layer uses the + base class (or OS_Thread_Adapter). This way we decouple the OS + layer from the ACE_Thread_Manager class. + + * ace/config-all.h: + Move the definition of ACE_THR_FUNC and ACE_THR_C_FUNC out here. + + * ace/OS_Thread_Adapter.h: + * ace/OS_Thread_Adapter.inl: + * ace/OS_Thread_Adapter.cpp: + Implement a version of ACE_Base_Thread_Adapter that does not use + the Thread_Manager at all. + + * ace/Thread_Adapter.h: + * ace/Thread_Adapter.inl: + * ace/Thread_Adapter.cpp: + Removed the common code to Base_Thread_Adapter.* + + * ace/Thread.h: + Include "ace/Thread_Adapter.h" directly because the OS layer + does not include it anymore. + + * ace/Thread_Hook.h: + * ace/Thread_Hook.cpp: + This class does not need to #include Thread_Manager.h + + * ace/Log_Msg.h: + * ace/Log_Msg.cpp: + Add another hook to make the ACE_OS_Thread_Descriptor available + to the OS layer when running MFC builds. + Thu Sep 7 12:07:14 2000 Ossama Othman <ossama@uci.edu> * bin/autoconf_compile (LOGBASE): diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index d185bc235aa..48b411a7428 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,55 @@ +Thu Sep 7 16:15:24 2000 Carlos O'Ryan <coryan@uci.edu> + + * ace/OS.h: + * ace/OS.cpp: + Break out the dependency between the ACE_Thread_Manager and the + OS layer. The OS layer used ACE_Thread_Adapter to create + threads, this class depends on ACE_Thread_Manager, but on the + path used by the OS layer the class does not use Thread_Manager + at all. The solution was to create a base class + (ACE_Base_Thread_Adapter) and a specialized version used in the + OS layer (ACE_OS_Thread_Adapter). + + * ace/Makefile: + * ace/Makefile.am: + * ace/Makefile.bor: + Update the Makefile and the dependencies. + + * ace/Base_Thread_Adapter.h: + * ace/Base_Thread_Adapter.inl: + * ace/Base_Thread_Adapter.cpp: + Abstract base class for ACE_Thread_Adapter. Applications + continue to use ACE_Thread_Adapter, but the OS layer uses the + base class (or OS_Thread_Adapter). This way we decouple the OS + layer from the ACE_Thread_Manager class. + + * ace/config-all.h: + Move the definition of ACE_THR_FUNC and ACE_THR_C_FUNC out here. + + * ace/OS_Thread_Adapter.h: + * ace/OS_Thread_Adapter.inl: + * ace/OS_Thread_Adapter.cpp: + Implement a version of ACE_Base_Thread_Adapter that does not use + the Thread_Manager at all. + + * ace/Thread_Adapter.h: + * ace/Thread_Adapter.inl: + * ace/Thread_Adapter.cpp: + Removed the common code to Base_Thread_Adapter.* + + * ace/Thread.h: + Include "ace/Thread_Adapter.h" directly because the OS layer + does not include it anymore. + + * ace/Thread_Hook.h: + * ace/Thread_Hook.cpp: + This class does not need to #include Thread_Manager.h + + * ace/Log_Msg.h: + * ace/Log_Msg.cpp: + Add another hook to make the ACE_OS_Thread_Descriptor available + to the OS layer when running MFC builds. + Thu Sep 7 12:07:14 2000 Ossama Othman <ossama@uci.edu> * bin/autoconf_compile (LOGBASE): diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index d185bc235aa..48b411a7428 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,55 @@ +Thu Sep 7 16:15:24 2000 Carlos O'Ryan <coryan@uci.edu> + + * ace/OS.h: + * ace/OS.cpp: + Break out the dependency between the ACE_Thread_Manager and the + OS layer. The OS layer used ACE_Thread_Adapter to create + threads, this class depends on ACE_Thread_Manager, but on the + path used by the OS layer the class does not use Thread_Manager + at all. The solution was to create a base class + (ACE_Base_Thread_Adapter) and a specialized version used in the + OS layer (ACE_OS_Thread_Adapter). + + * ace/Makefile: + * ace/Makefile.am: + * ace/Makefile.bor: + Update the Makefile and the dependencies. + + * ace/Base_Thread_Adapter.h: + * ace/Base_Thread_Adapter.inl: + * ace/Base_Thread_Adapter.cpp: + Abstract base class for ACE_Thread_Adapter. Applications + continue to use ACE_Thread_Adapter, but the OS layer uses the + base class (or OS_Thread_Adapter). This way we decouple the OS + layer from the ACE_Thread_Manager class. + + * ace/config-all.h: + Move the definition of ACE_THR_FUNC and ACE_THR_C_FUNC out here. + + * ace/OS_Thread_Adapter.h: + * ace/OS_Thread_Adapter.inl: + * ace/OS_Thread_Adapter.cpp: + Implement a version of ACE_Base_Thread_Adapter that does not use + the Thread_Manager at all. + + * ace/Thread_Adapter.h: + * ace/Thread_Adapter.inl: + * ace/Thread_Adapter.cpp: + Removed the common code to Base_Thread_Adapter.* + + * ace/Thread.h: + Include "ace/Thread_Adapter.h" directly because the OS layer + does not include it anymore. + + * ace/Thread_Hook.h: + * ace/Thread_Hook.cpp: + This class does not need to #include Thread_Manager.h + + * ace/Log_Msg.h: + * ace/Log_Msg.cpp: + Add another hook to make the ACE_OS_Thread_Descriptor available + to the OS layer when running MFC builds. + Thu Sep 7 12:07:14 2000 Ossama Othman <ossama@uci.edu> * bin/autoconf_compile (LOGBASE): diff --git a/ace/Base_Thread_Adapter.cpp b/ace/Base_Thread_Adapter.cpp new file mode 100644 index 00000000000..88b75272568 --- /dev/null +++ b/ace/Base_Thread_Adapter.cpp @@ -0,0 +1,130 @@ +// $Id$ + +#include "ace/Base_Thread_Adapter.h" +#include "ace/OS.h" + +ACE_RCSID(ace, Base_Thread_Adapter, "$Id$") + +#if !defined (ACE_HAS_INLINED_OSCALLS) +# include "ace/Base_Thread_Adapter.inl" +#endif /* ACE_HAS_INLINED_OS_CALLS */ + +ACE_INIT_LOG_MSG_HOOK ACE_Base_Thread_Adapter::init_log_msg_hook_ = 0; +ACE_INHERIT_LOG_MSG_HOOK ACE_Base_Thread_Adapter::inherit_log_msg_hook_ = 0; +ACE_CLOSE_LOG_MSG_HOOK ACE_Base_Thread_Adapter::close_log_msg_hook_ = 0; +ACE_SYNC_LOG_MSG_HOOK ACE_Base_Thread_Adapter::sync_log_msg_hook_ = 0; +ACE_THR_DESC_LOG_MSG_HOOK ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_ = 0; + +ACE_Base_Thread_Adapter::ACE_Base_Thread_Adapter ( + ACE_THR_FUNC user_func, + void *arg, + ACE_THR_C_FUNC entry_point, + ACE_OS_Thread_Descriptor *td +#if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + , ACE_SEH_EXCEPT_HANDLER selector + , ACE_SEH_EXCEPT_HANDLER handler +#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ + ) + : user_func_ (user_func) + , arg_ (arg) + , entry_point_ (entry_point) + , thr_desc_ (td) + , log_msg_attributes_ (0) +{ + ACE_OS_TRACE ("ACE_Base_Thread_Adapter::ACE_Base_Thread_Adapter"); + + if (ACE_Base_Thread_Adapter::init_log_msg_hook_ != 0) + (*ACE_Base_Thread_Adapter::init_log_msg_hook_) ( + this->log_msg_attributes_ +# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + , selector + , handler +# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ + ); +} + +ACE_Base_Thread_Adapter::~ACE_Base_Thread_Adapter (void) +{ +} + +void +ACE_Base_Thread_Adapter::inherit_log_msg (void) +{ + if (ACE_Base_Thread_Adapter::inherit_log_msg_hook_ != 0) + (*ACE_Base_Thread_Adapter::inherit_log_msg_hook_)( + this->thr_desc_, + this->log_msg_attributes_); +} + +void +ACE_Base_Thread_Adapter::close_log_msg (void) +{ + if (ACE_Base_Thread_Adapter::close_log_msg_hook_ != 0) + { + (*ACE_Base_Thread_Adapter::close_log_msg_hook_) (); + } +} + +void +ACE_Base_Thread_Adapter::sync_log_msg (const ACE_TCHAR *prg) +{ + if (ACE_Base_Thread_Adapter::sync_log_msg_hook_ != 0) + { + (*ACE_Base_Thread_Adapter::sync_log_msg_hook_) (prg); + } +} + +ACE_OS_Thread_Descriptor * +ACE_Base_Thread_Adapter::thr_desc_log_msg (void) +{ + if (ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_ != 0) + { + return (*ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_) (); + } + return 0; +} + +// Run the thread entry point for the <ACE_Thread_Adapter>. This must +// be an extern "C" to make certain compilers happy... + +#if defined (ACE_PSOS) +extern "C" void ace_thread_adapter (unsigned long args) +{ + ACE_OS_TRACE ("ace_thread_adapter"); + +#if defined (ACE_HAS_TSS_EMULATION) + // As early as we can in the execution of the new thread, allocate + // its local TS storage. Allocate it on the stack, to save dynamic + // allocation/dealloction. + void *ts_storage[ACE_TSS_Emulation::ACE_TSS_THREAD_KEYS_MAX]; + ACE_TSS_Emulation::tss_open (ts_storage); +#endif /* ACE_HAS_TSS_EMULATION */ + + ACE_Base_Thread_Adapter *thread_args = + ACE_static_cast(ACE_Base_Thread_Adapter *, args); + + // Invoke the user-supplied function with the args. + thread_args->invoke (); +} +#else /* ! defined (ACE_PSOS) */ +extern "C" void * ace_thread_adapter (void *args) +{ + ACE_OS_TRACE ("ace_thread_adapter"); + +#if defined (ACE_HAS_TSS_EMULATION) + // As early as we can in the execution of the new thread, allocate + // its local TS storage. Allocate it on the stack, to save dynamic + // allocation/dealloction. + void *ts_storage[ACE_TSS_Emulation::ACE_TSS_THREAD_KEYS_MAX]; + ACE_TSS_Emulation::tss_open (ts_storage); +#endif /* ACE_HAS_TSS_EMULATION */ + + ACE_Base_Thread_Adapter *thread_args = + ACE_static_cast (ACE_Base_Thread_Adapter *, args); + + // Invoke the user-supplied function with the args. + void *status = thread_args->invoke (); + + return status; +} +#endif /* ACE_PSOS */ diff --git a/ace/Base_Thread_Adapter.h b/ace/Base_Thread_Adapter.h new file mode 100644 index 00000000000..745611017d9 --- /dev/null +++ b/ace/Base_Thread_Adapter.h @@ -0,0 +1,164 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Base_Thread_Adapter.h +// +// = AUTHOR +// Carlos O'Ryan <coryan@uci.edu> +// +// ============================================================================ + +#ifndef ACE_BASE_THREAD_ADAPTER_H +#define ACE_BASE_THREAD_ADAPTER_H +#include "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/OS_Export.h" + +// Run the thread entry point for the <ACE_Thread_Adapter>. This must +// be an extern "C" to make certain compilers happy... +#if defined (ACE_PSOS) +extern "C" void ace_thread_adapter (unsigned long args); +#else /* ! defined (ACE_PSOS) */ +extern "C" ACE_Export void *ace_thread_adapter (void *args); +#endif /* ACE_PSOS */ + +class ACE_OS_Export ACE_OS_Thread_Descriptor +{ + // = TITLE + // Parent class of all ACE_Thread_Descriptor classes. + // + // = + // Container for ACE_Thread_Descriptor members that are + // used in ACE_OS. +public: + long flags (void) const; + // Get the thread creation flags. + +protected: + ACE_OS_Thread_Descriptor (long flags = 0); + // For use by ACE_Thread_Descriptor. + + long flags_; + // Keeps track of whether this thread was created "detached" or not. + // If a thread is *not* created detached then if someone calls + // <ACE_Thread_Manager::wait>, we need to join with that thread (and + // close down the handle). +}; + +class ACE_OS_Export ACE_Base_Thread_Adapter +{ + // = TITLE + // Base class for all the Thread_Adapters. + // + // = DESCRIPTION + // Converts a C++ function into a function <ace_thread_adapter> + // function that can be called from a thread creation routine + // (e.g., <pthread_create> or <_beginthreadex>) that expects an + // extern "C" entry point. This class also makes it possible to + // transparently provide hooks to register a thread with an + // <ACE_Thread_Manager>. + // This class is used in <ACE_OS::thr_create>. In general, the + // thread that creates an object of this class is different from + // the thread that calls <invoke> on this object. Therefore, + // the <invoke> method is responsible for deleting itself. +public: + ACE_Base_Thread_Adapter (ACE_THR_FUNC user_func, + void *arg, + ACE_THR_C_FUNC entry_point = (ACE_THR_C_FUNC) ace_thread_adapter, + ACE_OS_Thread_Descriptor *td = 0 +# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + , ACE_SEH_EXCEPT_HANDLER selector = 0 + , ACE_SEH_EXCEPT_HANDLER handler = 0 +# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ + ); + // Constructor. + + virtual void *invoke (void) = 0; + // Virtual method invoked by the thread entry point. + + ACE_THR_C_FUNC entry_point (void); + // Accessor for the C entry point function to the OS thread creation + // routine. + + static void close_log_msg (void); + // Invoke the close_log_msg_hook, if it is present + + static void sync_log_msg (const ACE_TCHAR *prog_name); + // Invoke the sync_log_msg_hook, if it is present + + static ACE_OS_Thread_Descriptor *thr_desc_log_msg (void); + // Invoke the thr_desc_log_msg_hook, if it is present + +protected: + virtual ~ACE_Base_Thread_Adapter (void); + // Destructor, making it private ensures that objects of this class + // are allocated on the heap. + + void inherit_log_msg (void); + // Inherit the logging features if the parent thread has an + // <ACE_Log_Msg>. + +private: + static ACE_INIT_LOG_MSG_HOOK init_log_msg_hook_; + static ACE_INHERIT_LOG_MSG_HOOK inherit_log_msg_hook_; + static ACE_CLOSE_LOG_MSG_HOOK close_log_msg_hook_; + static ACE_SYNC_LOG_MSG_HOOK sync_log_msg_hook_; + static ACE_THR_DESC_LOG_MSG_HOOK thr_desc_log_msg_hook_; + // The hooks to inherit and cleanup the Log_Msg attributes + + static void set_log_msg_hooks (ACE_INIT_LOG_MSG_HOOK init_hook, + ACE_INHERIT_LOG_MSG_HOOK inherit_hook, + ACE_CLOSE_LOG_MSG_HOOK close_hook, + ACE_SYNC_LOG_MSG_HOOK sync_hook, + ACE_THR_DESC_LOG_MSG_HOOK thr_desc); + // Set the Log_Msg hooks + + friend class ACE_Log_Msg; + // Allow the ACE_Log_Msg class to set its hooks. + +protected: + ACE_THR_FUNC user_func_; + // Thread startup function passed in by the user (C++ linkage). + + void *arg_; + // Argument to thread startup function. + + ACE_THR_C_FUNC entry_point_; + // Entry point to the underlying OS thread creation call (C + // linkage). + + ACE_OS_Thread_Descriptor *thr_desc_; + // Optional thread descriptor. Passing this pointer in will force + // the spawned thread to cache this location in <Log_Msg> and wait + // until <Thread_Manager> fills in all information in thread + // descriptor. + + void *log_msg_attributes_; + // The ACE_Log_Msg attributes. + + friend class ACE_Thread_Adapter_Has_Private_Destructor; + // Friend declaration to avoid compiler warning: only defines a private + // destructor and has no friends. +}; + +# if defined (ACE_HAS_INLINED_OSCALLS) +# if defined (ACE_INLINE) +# undef ACE_INLINE +# endif /* ACE_INLINE */ +# define ACE_INLINE inline +# include "ace/Base_Thread_Adapter.inl" +# endif /* ACE_HAS_INLINED_OSCALLS */ + +#include "ace/post.h" +#endif /* ACE_BASE_THREAD_ADAPTER_H */ diff --git a/ace/Base_Thread_Adapter.inl b/ace/Base_Thread_Adapter.inl new file mode 100644 index 00000000000..d20344e90cc --- /dev/null +++ b/ace/Base_Thread_Adapter.inl @@ -0,0 +1,22 @@ +// $Id$ + +ACE_INLINE void +ACE_Base_Thread_Adapter::set_log_msg_hooks ( + ACE_INIT_LOG_MSG_HOOK init_hook, + ACE_INHERIT_LOG_MSG_HOOK inherit_hook, + ACE_CLOSE_LOG_MSG_HOOK close_hook, + ACE_SYNC_LOG_MSG_HOOK sync_hook, + ACE_THR_DESC_LOG_MSG_HOOK thr_desc_hook) +{ + ACE_Base_Thread_Adapter::init_log_msg_hook_ = init_hook; + ACE_Base_Thread_Adapter::inherit_log_msg_hook_ = inherit_hook; + ACE_Base_Thread_Adapter::close_log_msg_hook_ = close_hook; + ACE_Base_Thread_Adapter::sync_log_msg_hook_ = sync_hook; + ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_ = thr_desc_hook; +} + +ACE_INLINE ACE_THR_C_FUNC +ACE_Base_Thread_Adapter::entry_point (void) +{ + return this->entry_point_; +} diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp index 6ab4aa3c3ea..bee6de900ff 100644 --- a/ace/Log_Msg.cpp +++ b/ace/Log_Msg.cpp @@ -378,6 +378,12 @@ ACE_Log_Msg::sync_hook (const ACE_TCHAR *prg_name) ACE_LOG_MSG->sync (prg_name); } +ACE_OS_Thread_Descriptor * +ACE_Log_Msg::thr_desc_hook (void) +{ + return ACE_LOG_MSG->thr_desc (); +} + // Call after a fork to resynchronize the PID and PROGRAM_NAME // variables. void @@ -515,7 +521,8 @@ ACE_Log_Msg::ACE_Log_Msg (void) ACE_Thread_Adapter::set_log_msg_hooks (ACE_Log_Msg_Attributes::init_hook, ACE_Log_Msg_Attributes::inherit_hook, ACE_Log_Msg::close, - ACE_Log_Msg::sync_hook); + ACE_Log_Msg::sync_hook, + ACE_Log_Msg::thr_desc_hook); } ACE_Log_Msg::~ACE_Log_Msg (void) @@ -1901,8 +1908,8 @@ ACE_Log_Msg_Attributes::inherit_log_msg (ACE_OS_Thread_Descriptor *thr_desc) if (thr_desc != 0) // This downcast is safe. We do it to avoid having to #include // ace/Thread_Manager.h. - ACE_LOG_MSG->thr_desc (ACE_reinterpret_cast (ACE_Thread_Descriptor *, - thr_desc)); + ACE_LOG_MSG->thr_desc (ACE_static_cast (ACE_Thread_Descriptor *, + thr_desc)); // Block the thread from proceeding until // thread manager has thread descriptor ready. diff --git a/ace/Log_Msg.h b/ace/Log_Msg.h index 0274eb69a9e..7c8837892b3 100644 --- a/ace/Log_Msg.h +++ b/ace/Log_Msg.h @@ -636,6 +636,9 @@ private: static void sync_hook (const ACE_TCHAR *prg_name); // Decouple the OS layer from the Log_Msg layer. + static ACE_OS_Thread_Descriptor *thr_desc_hook (void); + // Return the TSS singleton thread descriptor + friend void ACE_OS::cleanup_tss (const u_int); // = Disallow these operations. diff --git a/ace/Makefile b/ace/Makefile index 3170b0cadff..a81a43686f7 100644 --- a/ace/Makefile +++ b/ace/Makefile @@ -15,10 +15,9 @@ OS_FILES = \ OS_Memory \ OS_String \ OS_TLI \ + Base_Thread_Adapter \ + OS_Thread_Adapter \ Thread_Hook \ - Thread_Adapter \ - Thread_Exit \ - Thread_Control \ Sched_Params UTILS_FILES = \ ACE \ @@ -63,6 +62,9 @@ THREADS_FILES = \ Synch_Options \ Thread \ Thread_Manager \ + Thread_Adapter \ + Thread_Exit \ + Thread_Control \ Token DEMUX_FILES = \ Event_Handler \ @@ -579,7 +581,8 @@ endif # GHS OS.i \ Template_Instantiations.cpp -.obj/OS.o .obj/OS.so .shobj/OS.o .shobj/OS.so: OS.cpp OS.h \ +.obj/OS.o .obj/OS.so .shobj/OS.o .shobj/OS.so: OS.cpp \ + OS.h \ pre.h \ config-all.h \ config.h \ @@ -608,11 +611,10 @@ endif # GHS OS.i \ Sched_Params.h \ Sched_Params.i \ - Thread_Adapter.h \ - Thread_Adapter.inl \ - Thread_Exit.h \ - Thread_Control.h \ - Thread_Control.inl + OS_Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + OS_Thread_Adapter.inl .obj/OS_Dirent.o .obj/OS_Dirent.so .shobj/OS_Dirent.o .shobj/OS_Dirent.so: OS_Dirent.cpp \ OS_Dirent.h \ @@ -682,8 +684,8 @@ endif # GHS OS_Export.h \ OS_TLI.inl -.obj/Thread_Hook.o .obj/Thread_Hook.so .shobj/Thread_Hook.o .shobj/Thread_Hook.so: Thread_Hook.cpp \ - Thread_Hook.h \ +.obj/Base_Thread_Adapter.o .obj/Base_Thread_Adapter.so .shobj/Base_Thread_Adapter.o .shobj/Base_Thread_Adapter.so: Base_Thread_Adapter.cpp \ + Base_Thread_Adapter.h \ pre.h \ config-all.h \ config.h \ @@ -695,95 +697,10 @@ endif # GHS ACE_export.h \ svc_export.h \ ace_wchar.h \ - OS.h \ - OS_Dirent.h \ OS_Export.h \ - OS_Dirent.inl \ - OS_String.h \ - OS_String.inl \ - OS_Memory.h \ - OS_Memory.inl \ - OS_TLI.h \ - OS_TLI.inl \ - Min_Max.h \ - streams.h \ - Basic_Types.h \ - Basic_Types.i \ - Trace.h \ - OS.i \ - Thread_Manager.h \ - Thread.h \ - ACE.h \ - ACE.i \ - Thread.i \ - Thread_Adapter.h \ - Thread_Adapter.inl \ - Synch.h \ - SV_Semaphore_Complex.h \ - SV_Semaphore_Simple.h \ - SV_Semaphore_Simple.i \ - SV_Semaphore_Complex.i \ - Synch.i \ - Synch_T.h \ - Event_Handler.h \ - Event_Handler.i \ - Synch_T.i \ - Atomic_Op.i \ - Synch_T.cpp \ - Log_Msg.h \ - Log_Record.h \ - Log_Priority.h \ - Log_Record.i \ - Containers.h \ - Malloc_Base.h \ - Containers.i \ - Containers_T.h \ - Containers_T.i \ - Containers_T.cpp \ - Malloc.h \ - Based_Pointer_T.h \ - Based_Pointer_T.i \ - Based_Pointer_T.cpp \ - Based_Pointer_Repository.h \ - Singleton.h \ - Singleton.i \ - Singleton.cpp \ - Object_Manager.h \ - Object_Manager.i \ - Managed_Object.h \ - Managed_Object.i \ - Managed_Object.cpp \ - Malloc.i \ - Malloc_T.h \ - Free_List.h \ - Free_List.i \ - Free_List.cpp \ - Malloc_T.i \ - Malloc_T.cpp \ - Memory_Pool.h \ - Signal.h \ - Signal.i \ - Mem_Map.h \ - Mem_Map.i \ - Memory_Pool.i \ - Thread_Manager.i - -.obj/Thread_Adapter.o .obj/Thread_Adapter.so .shobj/Thread_Adapter.o .shobj/Thread_Adapter.so: Thread_Adapter.cpp \ - Thread_Adapter.h \ - pre.h \ - config-all.h \ - config.h \ - config-linux-lxpthreads.h \ - config-linux.h \ - config-linux-common.h \ - config-g++-common.h \ - post.h \ - ACE_export.h \ - svc_export.h \ - ace_wchar.h \ + Base_Thread_Adapter.inl \ OS.h \ OS_Dirent.h \ - OS_Export.h \ OS_Dirent.inl \ OS_String.h \ OS_String.inl \ @@ -796,70 +713,12 @@ endif # GHS Basic_Types.h \ Basic_Types.i \ Trace.h \ - OS.i \ - Thread_Adapter.inl \ - Thread_Manager.h \ - Thread.h \ - ACE.h \ - ACE.i \ - Thread.i \ - Synch.h \ - SV_Semaphore_Complex.h \ - SV_Semaphore_Simple.h \ - SV_Semaphore_Simple.i \ - SV_Semaphore_Complex.i \ - Synch.i \ - Synch_T.h \ - Event_Handler.h \ - Event_Handler.i \ - Synch_T.i \ - Atomic_Op.i \ - Synch_T.cpp \ - Log_Msg.h \ - Log_Record.h \ - Log_Priority.h \ - Log_Record.i \ - Containers.h \ - Malloc_Base.h \ - Containers.i \ - Containers_T.h \ - Containers_T.i \ - Containers_T.cpp \ - Malloc.h \ - Based_Pointer_T.h \ - Based_Pointer_T.i \ - Based_Pointer_T.cpp \ - Based_Pointer_Repository.h \ - Singleton.h \ - Singleton.i \ - Singleton.cpp \ - Object_Manager.h \ - Object_Manager.i \ - Managed_Object.h \ - Managed_Object.i \ - Managed_Object.cpp \ - Malloc.i \ - Malloc_T.h \ - Free_List.h \ - Free_List.i \ - Free_List.cpp \ - Malloc_T.i \ - Malloc_T.cpp \ - Memory_Pool.h \ - Signal.h \ - Signal.i \ - Mem_Map.h \ - Mem_Map.i \ - Memory_Pool.i \ - Thread_Manager.i \ - Thread_Exit.h \ - Thread_Control.h \ - Thread_Control.inl \ - Thread_Hook.h + OS.i -.obj/Thread_Exit.o .obj/Thread_Exit.so .shobj/Thread_Exit.o .shobj/Thread_Exit.so: Thread_Exit.cpp \ - Thread_Exit.h \ +.obj/OS_Thread_Adapter.o .obj/OS_Thread_Adapter.so .shobj/OS_Thread_Adapter.o .shobj/OS_Thread_Adapter.so: OS_Thread_Adapter.cpp \ + OS_Thread_Adapter.h \ pre.h \ + Base_Thread_Adapter.h \ config-all.h \ config.h \ config-linux-lxpthreads.h \ @@ -870,9 +729,12 @@ endif # GHS ACE_export.h \ svc_export.h \ ace_wchar.h \ + OS_Export.h \ + Base_Thread_Adapter.inl \ + OS_Thread_Adapter.inl \ + Thread_Hook.h \ OS.h \ OS_Dirent.h \ - OS_Export.h \ OS_Dirent.inl \ OS_String.h \ OS_String.inl \ @@ -885,37 +747,10 @@ endif # GHS Basic_Types.h \ Basic_Types.i \ Trace.h \ - OS.i \ - Thread_Control.h \ - Thread_Control.inl \ - Synch.h \ - ACE.h \ - ACE.i \ - SV_Semaphore_Complex.h \ - SV_Semaphore_Simple.h \ - SV_Semaphore_Simple.i \ - SV_Semaphore_Complex.i \ - Synch.i \ - Synch_T.h \ - Event_Handler.h \ - Event_Handler.i \ - Synch_T.i \ - Thread.h \ - Thread.i \ - Atomic_Op.i \ - Synch_T.cpp \ - Log_Msg.h \ - Log_Record.h \ - Log_Priority.h \ - Log_Record.i \ - Managed_Object.h \ - Object_Manager.h \ - Object_Manager.i \ - Managed_Object.i \ - Managed_Object.cpp + OS.i -.obj/Thread_Control.o .obj/Thread_Control.so .shobj/Thread_Control.o .shobj/Thread_Control.so: Thread_Control.cpp \ - Thread_Control.h \ +.obj/Thread_Hook.o .obj/Thread_Hook.so .shobj/Thread_Hook.o .shobj/Thread_Hook.so: Thread_Hook.cpp \ + Thread_Hook.h \ pre.h \ config-all.h \ config.h \ @@ -942,64 +777,7 @@ endif # GHS Basic_Types.h \ Basic_Types.i \ Trace.h \ - OS.i \ - Thread_Control.inl \ - Thread_Manager.h \ - Thread.h \ - ACE.h \ - ACE.i \ - Thread.i \ - Thread_Adapter.h \ - Thread_Adapter.inl \ - Synch.h \ - SV_Semaphore_Complex.h \ - SV_Semaphore_Simple.h \ - SV_Semaphore_Simple.i \ - SV_Semaphore_Complex.i \ - Synch.i \ - Synch_T.h \ - Event_Handler.h \ - Event_Handler.i \ - Synch_T.i \ - Atomic_Op.i \ - Synch_T.cpp \ - Log_Msg.h \ - Log_Record.h \ - Log_Priority.h \ - Log_Record.i \ - Containers.h \ - Malloc_Base.h \ - Containers.i \ - Containers_T.h \ - Containers_T.i \ - Containers_T.cpp \ - Malloc.h \ - Based_Pointer_T.h \ - Based_Pointer_T.i \ - Based_Pointer_T.cpp \ - Based_Pointer_Repository.h \ - Singleton.h \ - Singleton.i \ - Singleton.cpp \ - Object_Manager.h \ - Object_Manager.i \ - Managed_Object.h \ - Managed_Object.i \ - Managed_Object.cpp \ - Malloc.i \ - Malloc_T.h \ - Free_List.h \ - Free_List.i \ - Free_List.cpp \ - Malloc_T.i \ - Malloc_T.cpp \ - Memory_Pool.h \ - Signal.h \ - Signal.i \ - Mem_Map.h \ - Mem_Map.i \ - Memory_Pool.i \ - Thread_Manager.i + OS.i .obj/Sched_Params.o .obj/Sched_Params.so .shobj/Sched_Params.o .shobj/Sched_Params.so: Sched_Params.cpp \ Sched_Params.h \ @@ -1032,7 +810,8 @@ endif # GHS OS.i \ Sched_Params.i -.obj/ACE.o .obj/ACE.so .shobj/ACE.o .shobj/ACE.so: ACE.cpp ACE.h \ +.obj/ACE.o .obj/ACE.so .shobj/ACE.o .shobj/ACE.so: ACE.cpp \ + ACE.h \ pre.h \ OS.h \ config-all.h \ @@ -1101,6 +880,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -1174,6 +957,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -1324,6 +1111,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -1391,6 +1182,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -1519,6 +1314,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -1601,6 +1400,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -1732,6 +1535,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -1875,6 +1682,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -1990,6 +1801,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -2092,6 +1907,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -2295,6 +2114,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -2403,6 +2226,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -2472,6 +2299,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -2624,6 +2455,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -2717,6 +2552,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -2804,6 +2643,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -2903,6 +2746,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -2976,6 +2823,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -3064,6 +2915,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -3170,6 +3025,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -3218,9 +3077,11 @@ endif # GHS ACE.i \ Thread_Manager.h \ Thread.h \ - Thread.i \ Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ Thread_Adapter.inl \ + Thread.i \ Synch.h \ SV_Semaphore_Complex.h \ SV_Semaphore_Simple.h \ @@ -3373,6 +3234,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -3494,6 +3359,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -3566,8 +3435,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -3653,6 +3520,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -3719,6 +3590,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -3805,6 +3680,10 @@ endif # GHS Trace.h \ OS.i \ ACE.i \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Synch_T.h \ Event_Handler.h \ @@ -3887,6 +3766,10 @@ endif # GHS Trace.h \ OS.i \ ACE.i \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i .obj/Thread_Manager.o .obj/Thread_Manager.so .shobj/Thread_Manager.o .shobj/Thread_Manager.so: Thread_Manager.cpp \ @@ -3930,6 +3813,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -3938,8 +3825,6 @@ endif # GHS Log_Priority.h \ Log_Record.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Containers.h \ Malloc_Base.h \ Containers.i \ @@ -3982,6 +3867,247 @@ endif # GHS Thread_Control.h \ Thread_Control.inl +.obj/Thread_Adapter.o .obj/Thread_Adapter.so .shobj/Thread_Adapter.o .shobj/Thread_Adapter.so: Thread_Adapter.cpp \ + Thread_Adapter.h \ + pre.h \ + Base_Thread_Adapter.h \ + config-all.h \ + config.h \ + config-linux-lxpthreads.h \ + config-linux.h \ + config-linux-common.h \ + config-g++-common.h \ + post.h \ + ACE_export.h \ + svc_export.h \ + ace_wchar.h \ + OS_Export.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ + OS.h \ + OS_Dirent.h \ + OS_Dirent.inl \ + OS_String.h \ + OS_String.inl \ + OS_Memory.h \ + OS_Memory.inl \ + OS_TLI.h \ + OS_TLI.inl \ + Min_Max.h \ + streams.h \ + Basic_Types.h \ + Basic_Types.i \ + Trace.h \ + OS.i \ + Thread_Manager.h \ + Thread.h \ + ACE.h \ + ACE.i \ + Thread.i \ + Synch.h \ + SV_Semaphore_Complex.h \ + SV_Semaphore_Simple.h \ + SV_Semaphore_Simple.i \ + SV_Semaphore_Complex.i \ + Synch.i \ + Synch_T.h \ + Event_Handler.h \ + Event_Handler.i \ + Synch_T.i \ + Atomic_Op.i \ + Synch_T.cpp \ + Log_Msg.h \ + Log_Record.h \ + Log_Priority.h \ + Log_Record.i \ + Containers.h \ + Malloc_Base.h \ + Containers.i \ + Containers_T.h \ + Containers_T.i \ + Containers_T.cpp \ + Malloc.h \ + Based_Pointer_T.h \ + Based_Pointer_T.i \ + Based_Pointer_T.cpp \ + Based_Pointer_Repository.h \ + Singleton.h \ + Singleton.i \ + Singleton.cpp \ + Object_Manager.h \ + Object_Manager.i \ + Managed_Object.h \ + Managed_Object.i \ + Managed_Object.cpp \ + Malloc.i \ + Malloc_T.h \ + Free_List.h \ + Free_List.i \ + Free_List.cpp \ + Malloc_T.i \ + Malloc_T.cpp \ + Memory_Pool.h \ + Signal.h \ + Signal.i \ + Mem_Map.h \ + Mem_Map.i \ + Memory_Pool.i \ + Thread_Manager.i \ + Thread_Exit.h \ + Thread_Control.h \ + Thread_Control.inl \ + Thread_Hook.h + +.obj/Thread_Exit.o .obj/Thread_Exit.so .shobj/Thread_Exit.o .shobj/Thread_Exit.so: Thread_Exit.cpp \ + Thread_Exit.h \ + pre.h \ + config-all.h \ + config.h \ + config-linux-lxpthreads.h \ + config-linux.h \ + config-linux-common.h \ + config-g++-common.h \ + post.h \ + ACE_export.h \ + svc_export.h \ + ace_wchar.h \ + OS.h \ + OS_Dirent.h \ + OS_Export.h \ + OS_Dirent.inl \ + OS_String.h \ + OS_String.inl \ + OS_Memory.h \ + OS_Memory.inl \ + OS_TLI.h \ + OS_TLI.inl \ + Min_Max.h \ + streams.h \ + Basic_Types.h \ + Basic_Types.i \ + Trace.h \ + OS.i \ + Thread_Control.h \ + Thread_Control.inl \ + Synch.h \ + ACE.h \ + ACE.i \ + SV_Semaphore_Complex.h \ + SV_Semaphore_Simple.h \ + SV_Semaphore_Simple.i \ + SV_Semaphore_Complex.i \ + Synch.i \ + Synch_T.h \ + Event_Handler.h \ + Event_Handler.i \ + Synch_T.i \ + Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ + Thread.i \ + Atomic_Op.i \ + Synch_T.cpp \ + Log_Msg.h \ + Log_Record.h \ + Log_Priority.h \ + Log_Record.i \ + Managed_Object.h \ + Object_Manager.h \ + Object_Manager.i \ + Managed_Object.i \ + Managed_Object.cpp + +.obj/Thread_Control.o .obj/Thread_Control.so .shobj/Thread_Control.o .shobj/Thread_Control.so: Thread_Control.cpp \ + config-all.h \ + pre.h \ + config.h \ + config-linux-lxpthreads.h \ + config-linux.h \ + config-linux-common.h \ + config-g++-common.h \ + post.h \ + ACE_export.h \ + svc_export.h \ + ace_wchar.h \ + Thread_Control.h \ + OS.h \ + OS_Dirent.h \ + OS_Export.h \ + OS_Dirent.inl \ + OS_String.h \ + OS_String.inl \ + OS_Memory.h \ + OS_Memory.inl \ + OS_TLI.h \ + OS_TLI.inl \ + Min_Max.h \ + streams.h \ + Basic_Types.h \ + Basic_Types.i \ + Trace.h \ + OS.i \ + Thread_Control.inl \ + Thread_Manager.h \ + Thread.h \ + ACE.h \ + ACE.i \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ + Thread.i \ + Synch.h \ + SV_Semaphore_Complex.h \ + SV_Semaphore_Simple.h \ + SV_Semaphore_Simple.i \ + SV_Semaphore_Complex.i \ + Synch.i \ + Synch_T.h \ + Event_Handler.h \ + Event_Handler.i \ + Synch_T.i \ + Atomic_Op.i \ + Synch_T.cpp \ + Log_Msg.h \ + Log_Record.h \ + Log_Priority.h \ + Log_Record.i \ + Containers.h \ + Malloc_Base.h \ + Containers.i \ + Containers_T.h \ + Containers_T.i \ + Containers_T.cpp \ + Malloc.h \ + Based_Pointer_T.h \ + Based_Pointer_T.i \ + Based_Pointer_T.cpp \ + Based_Pointer_Repository.h \ + Singleton.h \ + Singleton.i \ + Singleton.cpp \ + Object_Manager.h \ + Object_Manager.i \ + Managed_Object.h \ + Managed_Object.i \ + Managed_Object.cpp \ + Malloc.i \ + Malloc_T.h \ + Free_List.h \ + Free_List.i \ + Free_List.cpp \ + Malloc_T.i \ + Malloc_T.cpp \ + Memory_Pool.h \ + Signal.h \ + Signal.i \ + Mem_Map.h \ + Mem_Map.i \ + Memory_Pool.i \ + Thread_Manager.i + .obj/Token.o .obj/Token.so .shobj/Token.o .shobj/Token.so: Token.cpp \ Thread.h \ pre.h \ @@ -4013,6 +4139,10 @@ endif # GHS Trace.h \ OS.i \ ACE.i \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Token.h \ Synch.h \ @@ -4086,6 +4216,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -4128,8 +4262,6 @@ endif # GHS Reactor.i \ Reactor_Impl.h \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i .obj/FlReactor.o .obj/FlReactor.so .shobj/FlReactor.o .shobj/FlReactor.so: FlReactor.cpp \ @@ -4178,6 +4310,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -4317,6 +4453,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -4388,8 +4528,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -4500,6 +4638,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -4608,6 +4750,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -4662,8 +4808,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -4739,6 +4883,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -4808,8 +4956,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -4892,6 +5038,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -4993,6 +5143,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -5145,6 +5299,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -5245,6 +5403,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -5369,6 +5531,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -5440,8 +5606,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -5506,6 +5670,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -5633,6 +5801,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -5826,6 +5998,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -5884,8 +6060,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -6378,6 +6552,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp @@ -6535,6 +6713,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -7026,7 +7208,8 @@ endif # GHS ATM_Addr.h \ ATM_Addr.i -.obj/DEV.o .obj/DEV.so .shobj/DEV.o .shobj/DEV.so: DEV.cpp DEV.h \ +.obj/DEV.o .obj/DEV.so .shobj/DEV.o .shobj/DEV.so: DEV.cpp \ + DEV.h \ pre.h \ IO_SAP.h \ ACE.h \ @@ -7809,6 +7992,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -8257,7 +8444,8 @@ endif # GHS Log_Priority.h \ Log_Record.i -.obj/TLI.o .obj/TLI.so .shobj/TLI.o .shobj/TLI.so: TLI.cpp TLI.h \ +.obj/TLI.o .obj/TLI.so .shobj/TLI.o .shobj/TLI.so: TLI.cpp \ + TLI.h \ pre.h \ IPC_SAP.h \ ACE.h \ @@ -8573,6 +8761,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -8635,8 +8827,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -8739,6 +8929,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -8801,8 +8995,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -8903,6 +9095,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -8965,8 +9161,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -9080,6 +9274,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -9233,6 +9431,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -9336,6 +9538,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -9427,6 +9633,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -9521,6 +9731,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -9558,7 +9772,8 @@ endif # GHS MEM_IO.i \ MEM_Stream.i -.obj/DLL.o .obj/DLL.so .shobj/DLL.o .shobj/DLL.so: DLL.cpp DLL.h \ +.obj/DLL.o .obj/DLL.so .shobj/DLL.o .shobj/DLL.so: DLL.cpp \ + DLL.h \ pre.h \ OS.h \ config-all.h \ @@ -9640,6 +9855,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -9697,8 +9916,6 @@ endif # GHS Service_Repository.i \ Task.h \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Task.i \ Task_T.h \ @@ -9795,6 +10012,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -9875,8 +10096,6 @@ endif # GHS Auto_Ptr.cpp \ Proactor.h \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Process_Manager.h \ Process.h \ @@ -9932,6 +10151,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -10021,8 +10244,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -10085,6 +10306,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -10141,6 +10366,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -10202,6 +10431,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -10213,8 +10446,6 @@ endif # GHS Stream_Modules.h \ Task.h \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Containers.h \ Malloc_Base.h \ Containers.i \ @@ -10393,6 +10624,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -10503,6 +10738,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -10569,8 +10808,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -10656,6 +10893,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -10759,6 +11000,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -10847,6 +11092,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -10906,8 +11155,6 @@ endif # GHS Synch_Options.h \ Synch_Options.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i \ Hash_Map_Manager.h \ Functor.h \ @@ -10968,9 +11215,11 @@ endif # GHS Service_Object.i \ Thread_Manager.h \ Thread.h \ - Thread.i \ Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ Thread_Adapter.inl \ + Thread.i \ Synch.h \ SV_Semaphore_Complex.h \ SV_Semaphore_Simple.h \ @@ -11117,6 +11366,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -11229,6 +11482,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -11338,6 +11595,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -11432,6 +11693,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -11515,6 +11780,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -11698,6 +11967,10 @@ endif # GHS Trace.h \ OS.i \ ACE.i \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Local_Tokens.h \ Synch_T.h \ @@ -11836,6 +12109,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -11944,6 +12221,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -12051,6 +12332,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -12158,6 +12443,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -12267,6 +12556,10 @@ endif # GHS Synch.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -12381,6 +12674,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -12435,8 +12732,6 @@ endif # GHS Pipe.h \ Pipe.i \ Thread_Manager.h \ - Thread_Adapter.h \ - Thread_Adapter.inl \ Thread_Manager.i .obj/CORBA_Ref.o .obj/CORBA_Ref.so .shobj/CORBA_Ref.o .shobj/CORBA_Ref.so: CORBA_Ref.cpp \ @@ -12536,6 +12831,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -12676,6 +12975,10 @@ endif # GHS Synch_T.h \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -12831,6 +13134,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -12953,6 +13260,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -13121,6 +13432,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -13257,6 +13572,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -13349,6 +13668,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -13438,6 +13761,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -13526,6 +13853,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ @@ -13596,6 +13927,10 @@ endif # GHS Event_Handler.i \ Synch_T.i \ Thread.h \ + Thread_Adapter.h \ + Base_Thread_Adapter.h \ + Base_Thread_Adapter.inl \ + Thread_Adapter.inl \ Thread.i \ Atomic_Op.i \ Synch_T.cpp \ diff --git a/ace/Makefile.am b/ace/Makefile.am index 4fb568f92b0..10b42bdba57 100644 --- a/ace/Makefile.am +++ b/ace/Makefile.am @@ -139,7 +139,8 @@ libACE_OS_la_SOURCES = \ OS_String.cpp \ OS_TLI.cpp \ Thread_Hook.cpp \ - Thread_Adapter.cpp \ + Base_Thread_Adapter.cpp \ + OS_Thread_Adapter.cpp \ Thread_Exit.cpp \ Thread_Control.cpp \ Sched_Params.cpp @@ -192,6 +193,7 @@ libACE_Threads_la_SOURCES = \ Synch.cpp \ Synch_Options.cpp \ Thread.cpp \ + Thread_Adapter.cpp \ Thread_Manager.cpp \ Token.cpp diff --git a/ace/Makefile.bor b/ace/Makefile.bor index 85363a3e121..ac5ae95adcd 100644 --- a/ace/Makefile.bor +++ b/ace/Makefile.bor @@ -98,6 +98,8 @@ OBJFILES = \ $(OBJDIR)\OS_String.obj \ $(OBJDIR)\OS_TLI.obj \ $(OBJDIR)\Thread_Hook.obj \ + $(OBJDIR)\Base_Thread_Adapter.obj \ + $(OBJDIR)\OS_Thread_Adapter.obj \ $(OBJDIR)\Thread_Adapter.obj \ $(OBJDIR)\Thread_Exit.obj \ $(OBJDIR)\Thread_Control.obj \ diff --git a/ace/OS.cpp b/ace/OS.cpp index 061230f058a..9918cb6b844 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -2,8 +2,7 @@ #include "ace/OS.h" #include "ace/Sched_Params.h" -#include "ace/Thread_Adapter.h" -#include "ace/Thread_Exit.h" +#include "ace/OS_Thread_Adapter.h" // Perhaps we should *always* include ace/OS.i in order to make sure // we can always link against the OS symbols? @@ -2313,7 +2312,7 @@ ACE_OS::cleanup_tss (const u_int main_thread) // main) thread. We don't have TSS emulation; if there's native // TSS, it should call its destructors when the main thread // exits. - ACE_Thread_Adapter::close_log_msg (); + ACE_Base_Thread_Adapter::close_log_msg (); #endif /* ! ACE_HAS_TSS_EMULATION && ! ACE_HAS_MINIMAL_ACE_OS */ #if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) @@ -2411,80 +2410,6 @@ ace_cleanup_destroyer (ACE_Cleanup *object, void *param) object->cleanup (param); } -// Run the thread entry point for the <ACE_Thread_Adapter>. This must -// be an extern "C" to make certain compilers happy... - -#if defined (ACE_PSOS) -extern "C" void ace_thread_adapter (unsigned long args) -{ - ACE_OS_TRACE ("ace_thread_adapter"); - -#if defined (ACE_HAS_TSS_EMULATION) - // As early as we can in the execution of the new thread, allocate - // its local TS storage. Allocate it on the stack, to save dynamic - // allocation/dealloction. - void *ts_storage[ACE_TSS_Emulation::ACE_TSS_THREAD_KEYS_MAX]; - ACE_TSS_Emulation::tss_open (ts_storage); -#endif /* ACE_HAS_TSS_EMULATION */ - - ACE_Thread_Adapter *thread_args = (ACE_Thread_Adapter *) args; - - // Invoke the user-supplied function with the args. - thread_args->invoke (); -} -#else /* ! defined (ACE_PSOS) */ -extern "C" void * ace_thread_adapter (void *args) -{ - ACE_OS_TRACE ("ace_thread_adapter"); - -#if defined (ACE_HAS_TSS_EMULATION) - // As early as we can in the execution of the new thread, allocate - // its local TS storage. Allocate it on the stack, to save dynamic - // allocation/dealloction. - void *ts_storage[ACE_TSS_Emulation::ACE_TSS_THREAD_KEYS_MAX]; - ACE_TSS_Emulation::tss_open (ts_storage); -#endif /* ACE_HAS_TSS_EMULATION */ - - ACE_Thread_Adapter *thread_args = (ACE_Thread_Adapter *) args; - - // Invoke the user-supplied function with the args. - void *status = thread_args->invoke (); - - return status; -} -#endif /* ACE_PSOS */ - - -ACE_Thread_Adapter::ACE_Thread_Adapter (ACE_THR_FUNC user_func, - void *arg, - ACE_THR_C_FUNC entry_point, - ACE_Thread_Manager *tm, - ACE_Thread_Descriptor *td -#if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - , ACE_SEH_EXCEPT_HANDLER selector, - ACE_SEH_EXCEPT_HANDLER handler -#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - ) - : user_func_ (user_func), - arg_ (arg), - entry_point_ (entry_point), - thr_mgr_ (tm), - // An ACE_Thread_Descriptor really is an ACE_OS_Thread_Descriptor. - // But without #including ace/Thread_Manager.h, we don't know that. - thr_desc_ (ACE_reinterpret_cast (ACE_OS_Thread_Descriptor *,td)), - log_msg_attributes_ (0) -{ - ACE_OS_TRACE ("Ace_Thread_Adapter::Ace_Thread_Adapter"); - - if (ACE_Thread_Adapter::init_log_msg_hook_ != 0) - (*ACE_Thread_Adapter::init_log_msg_hook_) (this->log_msg_attributes_ -# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) - , selector - , handler -# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ - ); -} - int ACE_OS::thr_create (ACE_THR_FUNC func, void *args, @@ -2494,7 +2419,7 @@ ACE_OS::thr_create (ACE_THR_FUNC func, long priority, void *stack, size_t stacksize, - ACE_Thread_Adapter *thread_adapter) + ACE_Base_Thread_Adapter *thread_adapter) { ACE_OS_TRACE ("ACE_OS::thr_create"); @@ -2515,12 +2440,12 @@ ACE_OS::thr_create (ACE_THR_FUNC func, # endif /* ! defined (ACE_NO_THREAD_ADAPTER) */ #if defined (ACE_HAS_PACE) - ACE_Thread_Adapter *thread_args; + ACE_Base_Thread_Adapter *thread_args; if (thread_adapter == 0) { ACE_NEW_RETURN (thread_args, - ACE_Thread_Adapter (func, args, - (ACE_THR_C_FUNC) ace_thread_adapter), + ACE_OS_Thread_Adapter (func, args, + (ACE_THR_C_FUNC) ace_thread_adapter), -1); } else @@ -2828,22 +2753,20 @@ ACE_OS::thr_create (ACE_THR_FUNC func, #else /* ACE_HAS_PACE */ - ACE_Thread_Adapter *thread_args; + ACE_Base_Thread_Adapter *thread_args; if (thread_adapter == 0) # if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) ACE_NEW_RETURN (thread_args, - ACE_Thread_Adapter (func, args, - (ACE_THR_C_FUNC) ace_thread_adapter, - 0, - 0, - ACE_OS_Object_Manager::seh_except_selector(), - ACE_OS_Object_Manager::seh_except_handler()), + ACE_OS_Thread_Adapter (func, args, + (ACE_THR_C_FUNC) ace_thread_adapter, + ACE_OS_Object_Manager::seh_except_selector(), + ACE_OS_Object_Manager::seh_except_handler()), -1); # else ACE_NEW_RETURN (thread_args, - ACE_Thread_Adapter (func, args, - (ACE_THR_C_FUNC) ace_thread_adapter), + ACE_OS_Thread_Adapter (func, args, + (ACE_THR_C_FUNC) ace_thread_adapter), -1); # endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ @@ -3678,8 +3601,7 @@ ACE_OS::thr_exit (void *status) // An ACE_Thread_Descriptor really is an ACE_OS_Thread_Descriptor. // But without #including ace/Thread_Manager.h, we don't know that. ACE_OS_Thread_Descriptor *td = - ACE_reinterpret_cast (ACE_OS_Thread_Descriptor *, - ACE_Log_Msg::instance ()->thr_desc ()); + ACE_Base_Thread_Adapter::thr_desc_log_msg (); if (td) using_afx = ACE_BIT_ENABLED (td->flags (), THR_USE_AFX); # endif /* ACE_HAS_MFC && (ACE_HAS_MFC != 0) */ @@ -4838,7 +4760,7 @@ ACE_OS::fork (const ACE_TCHAR *program_name) #if !defined (ACE_HAS_MINIMAL_ACE_OS) if (pid == 0) - ACE_Thread_Adapter::sync_log_msg (program_name); + ACE_Base_Thread_Adapter::sync_log_msg (program_name); #endif /* ! ACE_HAS_MINIMAL_ACE_OS */ return pid; @@ -6801,12 +6723,6 @@ ACE_OS_Object_Manager::fini (void) # endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ # endif /* ACE_MT_SAFE */ #endif /* ! ACE_HAS_STATIC_PREALLOCATION */ - - // @@ Shouldn't this be done in the ACE_Thread_Exit cleanup - // function? - ACE_Thread_Exit::is_constructed_ = 0; - // All TSS objects have been destroyed. Reset this flag so - // ACE_Thread_Exit singleton can be created again. } delete default_mask_; @@ -4168,7 +4168,7 @@ union semun // Create some useful typedefs. typedef const char **SYS_SIGLIST; -typedef void *(*ACE_THR_FUNC)(void *); + // This is for C++ static methods. # if defined (VXWORKS) typedef int ACE_THR_FUNC_INTERNAL_RETURN_TYPE; @@ -4184,19 +4184,6 @@ typedef void (*ACE_THR_C_DEST)(void *); } typedef void (*ACE_THR_DEST)(void *); -extern "C" -{ -# if defined (VXWORKS) -typedef FUNCPTR ACE_THR_C_FUNC; // where typedef int (*FUNCPTR) (...) -# elif defined (ACE_PSOS) -// needed to handle task entry point type inconsistencies in pSOS+ -typedef void (*PSOS_TASK_ENTRY_POINT)(); -typedef void (*ACE_THR_C_FUNC)(void *); -# else -typedef void *(*ACE_THR_C_FUNC)(void *); -# endif /* VXWORKS */ -} - # if !defined (MAP_FAILED) || defined (ACE_HAS_BROKEN_MAP_FAILED) # undef MAP_FAILED # define MAP_FAILED ((void *) -1) @@ -4455,7 +4442,7 @@ private: // ACE_Cleanup_Info). }; -class ACE_Thread_Adapter; +class ACE_Base_Thread_Adapter; class ACE_Thread_Hook; # if defined (ACE_HAS_PHARLAP_RT) @@ -5797,7 +5784,7 @@ public: long priority = ACE_DEFAULT_THREAD_PRIORITY, void *stack = 0, size_t stacksize = 0, - ACE_Thread_Adapter *thread_adapter = 0); + ACE_Base_Thread_Adapter *thread_adapter = 0); // Creates a new thread having <flags> attributes and running <func> // with <args> (if <thread_adapter> is non-0 then <func> and <args> // are ignored and are obtained from <thread_adapter>). <thr_id> diff --git a/ace/OS_Thread_Adapter.cpp b/ace/OS_Thread_Adapter.cpp new file mode 100644 index 00000000000..9615b839e71 --- /dev/null +++ b/ace/OS_Thread_Adapter.cpp @@ -0,0 +1,178 @@ +// $Id$ + +#include "ace/OS_Thread_Adapter.h" +#include "ace/Thread_Hook.h" +#include "ace/OS.h" + +ACE_RCSID(ace, OS_Thread_Adapter, "$Id$") + +#if !defined (ACE_HAS_INLINED_OSCALLS) +# include "ace/OS_Thread_Adapter.inl" +#endif /* ACE_HAS_INLINED_OS_CALLS */ + +ACE_OS_Thread_Adapter::ACE_OS_Thread_Adapter ( + ACE_THR_FUNC user_func + , void *arg + , ACE_THR_C_FUNC entry_point +# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + , ACE_SEH_EXCEPT_HANDLER selector + , ACE_SEH_EXCEPT_HANDLER handler +# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ + ) + : ACE_Base_Thread_Adapter (user_func, arg, entry_point +# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + , 0 + , selector + , handler +# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ + ) +{ +} + +ACE_OS_Thread_Adapter::~ACE_OS_Thread_Adapter (void) +{ +} + +void * +ACE_OS_Thread_Adapter::invoke (void) +{ + // Inherit the logging features if the parent thread has an + // ACE_Log_Msg instance in thread-specific storage. + this->inherit_log_msg (); + + // Extract the arguments. + ACE_THR_FUNC_INTERNAL func = + ACE_reinterpret_cast (ACE_THR_FUNC_INTERNAL, this->user_func_); + void *arg = this->arg_; + + // Delete ourselves since we don't need <this> anymore. Make sure + // not to access <this> anywhere below this point. + delete this; + +#if defined (ACE_NEEDS_LWP_PRIO_SET) + // On SunOS, the LWP priority needs to be set in order to get + // preemption when running in the RT class. This is the ACE way to + // do that . . . + ACE_hthread_t thr_handle; + ACE_OS::thr_self (thr_handle); + int prio; + + // thr_getprio () on the current thread should never fail. + ACE_OS::thr_getprio (thr_handle, prio); + + // ACE_OS::thr_setprio () has the special logic to set the LWP priority, + // if running in the RT class. + ACE_OS::thr_setprio (prio); + +#endif /* ACE_NEEDS_LWP_PRIO_SET */ + + void *status = 0; + + ACE_SEH_TRY + { + ACE_SEH_TRY + { + ACE_Thread_Hook *hook = + ACE_OS_Object_Manager::thread_hook (); + + if (hook) + // Invoke the start hook to give the user a chance to + // perform some initialization processing before the + // <func> is invoked. + status = hook->start (ACE_reinterpret_cast (ACE_THR_FUNC, func), + arg); + else + { + // Call thread entry point. +#if defined (ACE_PSOS) + (*func) (arg); +#else /* ! ACE_PSOS */ + status = ACE_reinterpret_cast (void *, (*func) (arg)); +#endif /* ACE_PSOS */ + } +#if defined (ACE_PSOS) + // pSOS task functions do not return a value. + status = 0; +#endif /* ACE_PSOS */ + } + +#if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + ACE_SEH_EXCEPT (ACE_OS_Object_Manager::seh_except_selector ()( + (void *) GetExceptionInformation ())) + { + ACE_OS_Object_Manager::seh_except_handler ()(0); + } +#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ + } + + ACE_SEH_FINALLY + { + // If we changed this to 1, change the respective if in + // Task::svc_run to 0. +#if 0 + // Call the <Task->close> hook. + if (func == ACE_reinterpret_cast (ACE_THR_FUNC_INTERNAL, + ACE_Task_Base::svc_run)) + { + ACE_Task_Base *task_ptr = (ACE_Task_Base *) arg; + ACE_Thread_Manager *thr_mgr_ptr = task_ptr->thr_mgr (); + + // This calls the Task->close () hook. + task_ptr->cleanup (task_ptr, 0); + + // This prevents a second invocation of the cleanup code + // (called later by <ACE_Thread_Manager::exit>. + thr_mgr_ptr->at_exit (task_ptr, 0, 0); + } +#endif /* 0 */ + +#if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) + // Call TSS destructors. + ACE_OS::cleanup_tss (0 /* not main thread */); + +# if defined (ACE_WIN32) + // Exit the thread. 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 defined (ACE_HAS_MFC) && (ACE_HAS_MFC != 0) + // Not spawned by ACE_Thread_Manager, use the old buggy + // version. You should seriously consider using + // ACE_Thread_Manager to spawn threads. The following code + // is know to cause some problem. + CWinThread *pThread = ::AfxGetThread (); + + if (!pThread || pThread->m_nThreadID != ACE_OS::thr_self ()) + ACE_ENDTHREADEX (status); + else + ::AfxEndThread ((DWORD)status); +# else + ACE_ENDTHREADEX (status); +# endif /* ACE_HAS_MFC && ACE_HAS_MFS != 0*/ +# endif /* ACE_WIN32 */ +#endif /* ACE_WIN32 || ACE_HAS_TSS_EMULATION */ + +#if defined (ACE_PSOS) + // This sequence of calls is documented by ISI as the proper way to + // clean up a pSOS task. They affect different components, so only + // try the ones for components that are built with ACE. +# if defined (SC_PREPC) && (SC_PREPC == YES) + ::fclose (0); // Return pREPC+ resources +# endif /* SC_PREPC */ +# if defined (SC_PHILE) && (SC_PHILE == YES) + ::close_f (0); // Return pHILE+ resources +# endif /* SC_PHILE */ +# if defined (SC_PNA) && (SC_PNA == YES) + ::close (0); // Return pNA+ resources +# endif /* SC_PNA */ +# if defined (SC_SC_PREPC) && (SC_PREPC == YES) + ::free (-1); // Return pREPC+ memory +# endif /* SC_PREPC */ + status = ::t_delete (0); // Suicide - only returns on error +#endif /* ACE_PSOS */ + + return status; + } + + ACE_NOTREACHED (return status); +} diff --git a/ace/OS_Thread_Adapter.h b/ace/OS_Thread_Adapter.h new file mode 100644 index 00000000000..faed0883a62 --- /dev/null +++ b/ace/OS_Thread_Adapter.h @@ -0,0 +1,78 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Thread_Adapter.h +// +// = AUTHOR +// Carlos O'Ryan <coryan@uci.edu> +// +// ============================================================================ + +#ifndef ACE_OS_THREAD_ADAPTER_H +#define ACE_OS_THREAD_ADAPTER_H +#include "ace/pre.h" + +#include "ace/Base_Thread_Adapter.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/OS_Export.h" + +class ACE_OS_Export ACE_OS_Thread_Adapter : public ACE_Base_Thread_Adapter +{ + // = TITLE + // Converts a C++ function into a function <ace_thread_adapter> + // function that can be called from a thread creation routine + // (e.g., <pthread_create> or <_beginthreadex>) that expects an + // extern "C" entry point. This class also makes it possible to + // transparently provide hooks to register a thread with an + // <ACE_Thread_Manager>. + // + // = DESCRIPTION + // This class is used in <ACE_OS::thr_create>. In general, the + // thread that creates an object of this class is different from + // the thread that calls <invoke> on this object. Therefore, + // the <invoke> method is responsible for deleting itself. +public: + ACE_OS_Thread_Adapter (ACE_THR_FUNC user_func, + void *arg, + ACE_THR_C_FUNC entry_point = (ACE_THR_C_FUNC) ace_thread_adapter +# if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + , ACE_SEH_EXCEPT_HANDLER selector = 0 + , ACE_SEH_EXCEPT_HANDLER handler = 0 +# endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ + ); + // Constructor. + + virtual void *invoke (void); + // Execute the <user_func_> with the <arg>. This function deletes + // <this>, thereby rendering the object useless after the call + // returns. + +private: + ~ACE_OS_Thread_Adapter (void); + // Ensure that this object must be allocated on the heap. + +private: + friend class ACE_Thread_Adapter_Has_Private_Destructor; + // Friend declaration to avoid compiler warning: only defines a private + // destructor and has no friends. +}; + +# if defined (ACE_HAS_INLINED_OSCALLS) +# if defined (ACE_INLINE) +# undef ACE_INLINE +# endif /* ACE_INLINE */ +# define ACE_INLINE inline +# include "ace/OS_Thread_Adapter.inl" +# endif /* ACE_HAS_INLINED_OSCALLS */ + +#include "ace/post.h" +#endif /* ACE_THREAD_ADAPTER_H */ diff --git a/ace/OS_Thread_Adapter.inl b/ace/OS_Thread_Adapter.inl new file mode 100644 index 00000000000..cfa1da318d3 --- /dev/null +++ b/ace/OS_Thread_Adapter.inl @@ -0,0 +1 @@ +// $Id$ diff --git a/ace/Thread.h b/ace/Thread.h index 8948ebda2c1..0f76790c930 100644 --- a/ace/Thread.h +++ b/ace/Thread.h @@ -19,6 +19,7 @@ #include "ace/pre.h" #include "ace/ACE.h" +#include "ace/Thread_Adapter.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/Thread_Adapter.cpp b/ace/Thread_Adapter.cpp index 7a54dc5154f..5c29550410e 100644 --- a/ace/Thread_Adapter.cpp +++ b/ace/Thread_Adapter.cpp @@ -1,6 +1,7 @@ // $Id$ #include "ace/Thread_Adapter.h" +#include "ace/OS.h" #include "ace/Thread_Manager.h" #include "ace/Thread_Exit.h" #include "ace/Thread_Hook.h" @@ -11,35 +12,33 @@ ACE_RCSID(ace, Thread_Adapter, "$Id$") # include "ace/Thread_Adapter.inl" #endif /* ACE_HAS_INLINED_OS_CALLS */ -ACE_INIT_LOG_MSG_HOOK ACE_Thread_Adapter::init_log_msg_hook_ = 0; -ACE_INHERIT_LOG_MSG_HOOK ACE_Thread_Adapter::inherit_log_msg_hook_ = 0; -ACE_CLOSE_LOG_MSG_HOOK ACE_Thread_Adapter::close_log_msg_hook_ = 0; -ACE_SYNC_LOG_MSG_HOOK ACE_Thread_Adapter::sync_log_msg_hook_ = 0; - -void -ACE_Thread_Adapter::inherit_log_msg (void) -{ - if (ACE_Thread_Adapter::inherit_log_msg_hook_ != 0) - (*ACE_Thread_Adapter::inherit_log_msg_hook_)(this->thr_desc_, - this->log_msg_attributes_); -} - -void -ACE_Thread_Adapter::close_log_msg (void) +ACE_Thread_Adapter::ACE_Thread_Adapter (ACE_THR_FUNC user_func, + void *arg, + ACE_THR_C_FUNC entry_point, + ACE_Thread_Manager *tm, + ACE_Thread_Descriptor *td +#if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + , ACE_SEH_EXCEPT_HANDLER selector, + ACE_SEH_EXCEPT_HANDLER handler +#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ + ) + : ACE_Base_Thread_Adapter ( + user_func + , arg + , entry_point + , td +#if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) + , selector + , handler +#endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ + ) + , thr_mgr_ (tm) { - if (ACE_Thread_Adapter::close_log_msg_hook_ != 0) - { - (*ACE_Thread_Adapter::close_log_msg_hook_) (); - } + ACE_OS_TRACE ("Ace_Thread_Adapter::Ace_Thread_Adapter"); } -void -ACE_Thread_Adapter::sync_log_msg (const ACE_TCHAR *prg) +ACE_Thread_Adapter::~ACE_Thread_Adapter (void) { - if (ACE_Thread_Adapter::sync_log_msg_hook_ != 0) - { - (*ACE_Thread_Adapter::sync_log_msg_hook_) (prg); - } } void * diff --git a/ace/Thread_Adapter.h b/ace/Thread_Adapter.h index 9da861cb5d3..8ef0fc4388f 100644 --- a/ace/Thread_Adapter.h +++ b/ace/Thread_Adapter.h @@ -17,50 +17,17 @@ #define ACE_THREAD_ADAPTER_H #include "ace/pre.h" -#include "ace/config-all.h" +#include "ace/Base_Thread_Adapter.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/OS.h" - -// Run the thread entry point for the <ACE_Thread_Adapter>. This must -// be an extern "C" to make certain compilers happy... -#if defined (ACE_PSOS) -extern "C" void ace_thread_adapter (unsigned long args); -#else /* ! defined (ACE_PSOS) */ -extern "C" ACE_Export void *ace_thread_adapter (void *args); -#endif /* ACE_PSOS */ - -class ACE_OS_Thread_Descriptor -{ - // = TITLE - // Parent class of all ACE_Thread_Descriptor classes. - // - // = - // Container for ACE_Thread_Descriptor members that are - // used in ACE_OS. -public: - long flags (void) const; - // Get the thread creation flags. - -protected: - ACE_OS_Thread_Descriptor (long flags = 0); - // For use by ACE_Thread_Descriptor. - - long flags_; - // Keeps track of whether this thread was created "detached" or not. - // If a thread is *not* created detached then if someone calls - // <ACE_Thread_Manager::wait>, we need to join with that thread (and - // close down the handle). -}; - // Forward decl. class ACE_Thread_Manager; class ACE_Thread_Descriptor; -class ACE_Export ACE_Thread_Adapter +class ACE_Export ACE_Thread_Adapter : public ACE_Base_Thread_Adapter { // = TITLE // Converts a C++ function into a function <ace_thread_adapter> @@ -88,7 +55,7 @@ public: ); // Constructor. - void *invoke (void); + virtual void *invoke (void); // Execute the <user_func_> with the <arg>. This function deletes // <this>, thereby rendering the object useless after the call // returns. @@ -96,62 +63,14 @@ public: ACE_Thread_Manager *thr_mgr (void); // Accessor for the optional <Thread_Manager>. - ACE_THR_C_FUNC entry_point (void); - // Accessor for the C entry point function to the OS thread creation - // routine. - - static void close_log_msg (void); - // Invoke the close_log_msg_hook, if it is present - - static void sync_log_msg (const ACE_TCHAR *prog_name); - // Invoke the sync_log_msg_hook, if it is present - private: ~ACE_Thread_Adapter (void); // Ensure that this object must be allocated on the heap. - void inherit_log_msg (void); - // Inherit the logging features if the parent thread has an - // <ACE_Log_Msg>. - - static ACE_INIT_LOG_MSG_HOOK init_log_msg_hook_; - static ACE_INHERIT_LOG_MSG_HOOK inherit_log_msg_hook_; - static ACE_CLOSE_LOG_MSG_HOOK close_log_msg_hook_; - static ACE_SYNC_LOG_MSG_HOOK sync_log_msg_hook_; - // The hooks to inherit and cleanup the Log_Msg attributes - - static void set_log_msg_hooks (ACE_INIT_LOG_MSG_HOOK init_hook, - ACE_INHERIT_LOG_MSG_HOOK inherit_hook, - ACE_CLOSE_LOG_MSG_HOOK close_hook, - ACE_SYNC_LOG_MSG_HOOK sync_hook); - // Set the Log_Msg hooks - - friend class ACE_Log_Msg; - // Allow the ACE_Log_Msg class to set its hooks. - private: - ACE_THR_FUNC user_func_; - // Thread startup function passed in by the user (C++ linkage). - - void *arg_; - // Argument to thread startup function. - - ACE_THR_C_FUNC entry_point_; - // Entry point to the underlying OS thread creation call (C - // linkage). - ACE_Thread_Manager *thr_mgr_; // Optional thread manager. - ACE_OS_Thread_Descriptor *thr_desc_; - // Optional thread descriptor. Passing this pointer in will force - // the spawned thread to cache this location in <Log_Msg> and wait - // until <Thread_Manager> fills in all information in thread - // descriptor. - - void *log_msg_attributes_; - // The ACE_Log_Msg attributes. - friend class ACE_Thread_Adapter_Has_Private_Destructor; // Friend declaration to avoid compiler warning: only defines a private // destructor and has no friends. diff --git a/ace/Thread_Adapter.inl b/ace/Thread_Adapter.inl index 715e267a1d2..8bb1cd917a8 100644 --- a/ace/Thread_Adapter.inl +++ b/ace/Thread_Adapter.inl @@ -3,7 +3,6 @@ ACE_INLINE long ACE_OS_Thread_Descriptor::flags (void) const { - ACE_OS_TRACE ("ACE_OS_Thread_Descriptor::flags"); return flags_; } @@ -14,31 +13,8 @@ ACE_OS_Thread_Descriptor::ACE_OS_Thread_Descriptor (long flags) { } -ACE_INLINE void -ACE_Thread_Adapter::set_log_msg_hooks (ACE_INIT_LOG_MSG_HOOK init_hook, - ACE_INHERIT_LOG_MSG_HOOK inherit_hook, - ACE_CLOSE_LOG_MSG_HOOK close_hook, - ACE_SYNC_LOG_MSG_HOOK sync_hook) -{ - ACE_Thread_Adapter::init_log_msg_hook_ = init_hook; - ACE_Thread_Adapter::inherit_log_msg_hook_ = inherit_hook; - ACE_Thread_Adapter::close_log_msg_hook_ = close_hook; - ACE_Thread_Adapter::sync_log_msg_hook_ = sync_hook; -} - ACE_INLINE ACE_Thread_Manager * ACE_Thread_Adapter::thr_mgr (void) { return this->thr_mgr_; } - -ACE_INLINE -ACE_Thread_Adapter::~ACE_Thread_Adapter (void) -{ -} - -ACE_INLINE ACE_THR_C_FUNC -ACE_Thread_Adapter::entry_point (void) -{ - return this->entry_point_; -} diff --git a/ace/Thread_Hook.cpp b/ace/Thread_Hook.cpp index 37fc54a4a66..08c37afbaf6 100644 --- a/ace/Thread_Hook.cpp +++ b/ace/Thread_Hook.cpp @@ -1,7 +1,7 @@ // $Id$ #include "ace/Thread_Hook.h" -#include "ace/Thread_Manager.h" +#include "ace/OS.h" ACE_RCSID(ace, Thread_Hook, "$Id$") diff --git a/ace/Thread_Hook.h b/ace/Thread_Hook.h index a1312e1ec8d..cc9a8ef9623 100644 --- a/ace/Thread_Hook.h +++ b/ace/Thread_Hook.h @@ -23,9 +23,9 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/OS.h" +#include "ace/OS_Export.h" -class ACE_Export ACE_Thread_Hook +class ACE_OS_Export ACE_Thread_Hook { // = TITLE // This class makes it possible to provide user-defined "start" diff --git a/ace/ace-lib.icc b/ace/ace-lib.icc index 1663a3874ee..6f564482c70 100644 --- a/ace/ace-lib.icc +++ b/ace/ace-lib.icc @@ -159,6 +159,9 @@ option source type(cpp) "System_Time.cpp" source type(cpp) "Task.cpp" source type(cpp) "Thread.cpp" + source type(cpp) "Base_Thread_Adapter.cpp" + source type(cpp) "OS_Thread_Adapter.cpp" + source type(cpp) "Thread_Adapter.cpp" source type(cpp) "Thread_Manager.cpp" source type(cpp) "Time_Request_Reply.cpp" source type(cpp) "Timeprobe.cpp" diff --git a/ace/ace.icc b/ace/ace.icc index 8fd443ac052..612d696d4fc 100755 --- a/ace/ace.icc +++ b/ace/ace.icc @@ -81,6 +81,8 @@ option source type (cpp) "OS_String.cpp" source type (cpp) "OS_TLI.cpp" source type (cpp) "Thread_Hook.cpp" + source type (cpp) "Base_Thread_Adapter.cpp" + source type (cpp) "OS_Thread_Adapter.cpp" source type (cpp) "Thread_Adapter.cpp" source type (cpp) "Thread_Exit.cpp" source type (cpp) "Thread_Control.cpp" diff --git a/ace/config-all.h b/ace/config-all.h index f3ce51fdac6..89fc0c0a612 100644 --- a/ace/config-all.h +++ b/ace/config-all.h @@ -510,6 +510,8 @@ typedef void (*ACE_CLOSE_LOG_MSG_HOOK) (void); typedef void (*ACE_SYNC_LOG_MSG_HOOK) (const ACE_TCHAR *prog_name); +typedef ACE_OS_Thread_Descriptor *(*ACE_THR_DESC_LOG_MSG_HOOK) (void); + // ============================================================================ // Fundamental types // ============================================================================ @@ -528,6 +530,21 @@ typedef ACE_HANDLE ACE_SOCKET; #endif /* ACE_WIN32 */ +typedef void *(*ACE_THR_FUNC)(void *); + +extern "C" +{ +# if defined (VXWORKS) +typedef FUNCPTR ACE_THR_C_FUNC; // where typedef int (*FUNCPTR) (...) +# elif defined (ACE_PSOS) +// needed to handle task entry point type inconsistencies in pSOS+ +typedef void (*PSOS_TASK_ENTRY_POINT)(); +typedef void (*ACE_THR_C_FUNC)(void *); +# else +typedef void *(*ACE_THR_C_FUNC)(void *); +# endif /* VXWORKS */ +} + // ============================================================================ // Miscellaneous macros // ============================================================================ |