diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-26 17:58:28 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-26 17:58:28 +0000 |
commit | 65c6b41c60caa972f182a794d2b421961fd16c01 (patch) | |
tree | d0538ef33bfc6aa067a49679d7e2facdff47bb24 | |
parent | 91cff0f2ec4324d6e91878ed7e929838aafa74e0 (diff) | |
download | ATCD-65c6b41c60caa972f182a794d2b421961fd16c01.tar.gz |
more VxWorks_shlib updates
-rw-r--r-- | ace/Makefile | 37 | ||||
-rw-r--r-- | ace/OS.cpp | 98 | ||||
-rw-r--r-- | ace/OS.h | 71 | ||||
-rw-r--r-- | ace/Object_Manager.cpp | 9 |
4 files changed, 105 insertions, 110 deletions
diff --git a/ace/Makefile b/ace/Makefile index 5b5bc0d5cd3..922f0d13340 100644 --- a/ace/Makefile +++ b/ace/Makefile @@ -43,7 +43,6 @@ LOGGING_FILES = \ Dump \ Log_Msg \ Log_Msg_Manager \ - Log_Msg_s \ Log_Record \ Trace THREADS_FILES = \ @@ -330,15 +329,17 @@ ifneq (,$(findstring Memory,$(ACE_COMPONENTS))) FILES += $(MEMORY_FILES) endif # Memory -ifneq (,$(findstring Token,$(ACE_COMPONENTS))) +ifeq (,$(findstring Token,$(ACE_COMPONENTS))) + CCFLAGS += -DACE_LACKS_ACE_TOKEN +else # ! Token FILES += $(TOKEN_FILES) -endif # Token +endif # ! Token ifeq (,$(findstring Other,$(ACE_COMPONENTS))) CCFLAGS += -DACE_LACKS_ACE_OTHER -else +else # ! Other FILES += $(OTHER_FILES) -endif # Other +endif # ! Other ifeq ($(AIX_TEMPLATE_HACK),1) FILES = 0_ACE_All_Src @@ -347,12 +348,34 @@ endif LSRC = $(addsuffix .cpp,$(FILES)) -BUILD += ACE_COMPONENTS - include $(ACE_ROOT)/include/makeinclude/macros.GNU include $(ACE_ROOT)/include/makeinclude/rules.common.GNU include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU + +ifeq (1,$(VXWORKS)) + ifeq (1,$(shared_libs)) + BUILD += libACE_s.a + + ifneq (,$(findstring OS,$(ACE_COMPONENTS))) + ACE_STATIC_FILES += OS_s + endif # OS + ifneq (,$(findstring Utils,$(ACE_COMPONENTS))) + ACE_STATIC_FILES += Object_Manager_s + endif # Utils + ifneq (,$(findstring Logging,$(ACE_COMPONENTS))) + ACE_STATIC_FILES += Log_Msg_s + endif # Logging + endif # shared_libs + + ACE_STATIC_OBJS = $(addprefix $(VDIR),$(addsuffix .o,$(ACE_STATIC_FILES))) + + libACE_s.a: $(ACE_STATIC_OBJS) + $(AR) $(ARFLAGS) $@ $? +endif # VXWORKS + +BUILD += ACE_COMPONENTS + #### Disable installs in this ($(ACE_ROOT)/ace) directory, because this #### is the (default) destination of installs anyways. This line prevents #### creation of a link from the ACE library to itself when the build of diff --git a/ace/OS.cpp b/ace/OS.cpp index f1dd9c50071..79c2c090d7c 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -203,8 +203,6 @@ ACE_OS::netdb_release (void) # define ACE_TSS_BASE_GUARD #endif /* ! ACE_MT_SAFE */ -ACE_EXIT_HOOK ACE_OS::exit_hook_ = 0; - // Static constant representing `zero-time'. // Note: this object requires static construction. const ACE_Time_Value ACE_Time_Value::zero; @@ -1569,80 +1567,6 @@ ACE_TSS_Keys::test_and_clear (const ACE_thread_key_t key) } } -class ACE_TSS_Cleanup - // = TITLE - // Singleton that knows how to clean up all the thread-specific - // resources for Win32. - // - // = DESCRIPTION - // All this nonsense is required since Win32 doesn't - // automatically cleanup thread-specific storage on thread exit, - // unlike real operating systems... ;-) -{ -public: - static ACE_TSS_Cleanup *instance (void); - - ~ACE_TSS_Cleanup (void); - - void exit (void *status); - // Cleanup the thread-specific objects. Does _NOT_ exit the thread. - - int insert (ACE_thread_key_t key, void (*destructor)(void *), void *inst); - // Insert a <key, destructor> tuple into the table. - - int remove (ACE_thread_key_t key); - // Remove a <key, destructor> tuple from the table. - - int detach (void *inst); - // Detaches a tss_instance from its key. - - void key_used (ACE_thread_key_t key); - // Mark a key as being used by this thread. - - int free_all_keys_left (void); - // Free all keys left in the table before destruction. - - static int lockable () { return instance_ != 0; } - // Indication of whether the ACE_TSS_CLEANUP_LOCK is usable, and - // therefore whether we are in static constructor/destructor phase - // or not. - -protected: - void dump (void); - - ACE_TSS_Cleanup (void); - // Ensure singleton. - -private: - // Array of <ACE_TSS_Info> objects. - typedef ACE_TSS_Info ACE_TSS_TABLE[ACE_DEFAULT_THREAD_KEYS]; - typedef ACE_TSS_Info *ACE_TSS_TABLE_ITERATOR; - - ACE_TSS_TABLE table_; - // Table of <ACE_TSS_Info>'s. - - ACE_thread_key_t in_use_; - // Key for the thread-specific array of whether each TSS key is in use. - - ACE_TSS_Keys *tss_keys (); - // Accessor for this threads ACE_TSS_Keys instance. - -#if defined (ACE_HAS_TSS_EMULATION) - ACE_thread_key_t in_use_key_; - // Key that is used by in_use_. We save this key so that we know - // not to call its destructor in free_all_keys_left (). -#endif /* ACE_HAS_TSS_EMULATION */ - - // = Static data. - static ACE_TSS_Cleanup *instance_; - // Pointer to the singleton instance. -}; - -// = Static object initialization. - -// Pointer to the singleton instance. -ACE_TSS_Cleanup *ACE_TSS_Cleanup::instance_ = 0; - ACE_TSS_Cleanup::~ACE_TSS_Cleanup (void) { // Zero out the instance pointer to support lockable () accessor. @@ -1985,22 +1909,13 @@ ACE_TSS_Cleanup::tss_keys () } # if defined (ACE_HAS_TSS_EMULATION) -u_int ACE_TSS_Emulation::total_keys_ = 0; - -ACE_TSS_Emulation::ACE_TSS_DESTRUCTOR -ACE_TSS_Emulation::tss_destructor_[ACE_TSS_Emulation::ACE_TSS_THREAD_KEYS_MAX] - = { 0 }; - -#if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) -int ACE_TSS_Emulation::key_created_ = 0; - -ACE_OS_thread_key_t ACE_TSS_Emulation::native_tss_key_; +# if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) /* static */ -#if defined (ACE_HAS_THR_C_FUNC) +# if defined (ACE_HAS_THR_C_FUNC) extern "C" -#endif /* ACE_HAS_THR_C_FUNC */ +# endif /* ACE_HAS_THR_C_FUNC */ void ACE_TSS_Emulation_cleanup (void *ptr) { @@ -2084,7 +1999,7 @@ ACE_TSS_Emulation::tss_base (void* ts_storage[], u_int *ts_created) return ts_storage ? ts_storage : old_ts_storage; } -#endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE */ +# endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE */ u_int ACE_TSS_Emulation::total_keys () @@ -6269,11 +6184,6 @@ ACE_OS_Object_Manager_Internal_Exit_Hook () ACE_OS_Object_Manager::instance ()->fini (); } -ACE_OS_Object_Manager *ACE_OS_Object_Manager::instance_ = 0; - -void *ACE_OS_Object_Manager::preallocated_object[ - ACE_OS_Object_Manager::ACE_OS_PREALLOCATED_OBJECTS] = { 0 }; - ACE_OS_Object_Manager::ACE_OS_Object_Manager () { // If instance_ was not 0, then another ACE_OS_Object_Manager has @@ -6991,6 +6991,77 @@ private: // use by this thread. }; +class ACE_TSS_Cleanup + // = TITLE + // Singleton that knows how to clean up all the thread-specific + // resources for Win32. + // + // = DESCRIPTION + // All this nonsense is required since Win32 doesn't + // automatically cleanup thread-specific storage on thread exit, + // unlike real operating systems... ;-) + // + // For internal use by ACE, only! +{ +public: + static ACE_TSS_Cleanup *instance (void); + + ~ACE_TSS_Cleanup (void); + + void exit (void *status); + // Cleanup the thread-specific objects. Does _NOT_ exit the thread. + + int insert (ACE_thread_key_t key, void (*destructor)(void *), void *inst); + // Insert a <key, destructor> tuple into the table. + + int remove (ACE_thread_key_t key); + // Remove a <key, destructor> tuple from the table. + + int detach (void *inst); + // Detaches a tss_instance from its key. + + void key_used (ACE_thread_key_t key); + // Mark a key as being used by this thread. + + int free_all_keys_left (void); + // Free all keys left in the table before destruction. + + static int lockable () { return instance_ != 0; } + // Indication of whether the ACE_TSS_CLEANUP_LOCK is usable, and + // therefore whether we are in static constructor/destructor phase + // or not. + +protected: + void dump (void); + + ACE_TSS_Cleanup (void); + // Ensure singleton. + +private: + // Array of <ACE_TSS_Info> objects. + typedef ACE_TSS_Info ACE_TSS_TABLE[ACE_DEFAULT_THREAD_KEYS]; + typedef ACE_TSS_Info *ACE_TSS_TABLE_ITERATOR; + + ACE_TSS_TABLE table_; + // Table of <ACE_TSS_Info>'s. + + ACE_thread_key_t in_use_; + // Key for the thread-specific array of whether each TSS key is in use. + + ACE_TSS_Keys *tss_keys (); + // Accessor for this threads ACE_TSS_Keys instance. + +#if defined (ACE_HAS_TSS_EMULATION) + ACE_thread_key_t in_use_key_; + // Key that is used by in_use_. We save this key so that we know + // not to call its destructor in free_all_keys_left (). +#endif /* ACE_HAS_TSS_EMULATION */ + + // = Static data. + static ACE_TSS_Cleanup *instance_; + // Pointer to the singleton instance. +}; + # endif /* defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) */ class ACE_Export ACE_OS_WString diff --git a/ace/Object_Manager.cpp b/ace/Object_Manager.cpp index 70c0d7fee03..a2dd7224424 100644 --- a/ace/Object_Manager.cpp +++ b/ace/Object_Manager.cpp @@ -38,15 +38,6 @@ ACE_RCSID(ace, Object_Manager, "$Id$") # define ACE_APPLICATION_PREALLOCATED_ARRAY_DELETIONS #endif /* ACE_APPLICATION_PREALLOCATED_ARRAY_DELETIONS */ -// Singleton pointer. -ACE_Object_Manager *ACE_Object_Manager::instance_ = 0; - -void *ACE_Object_Manager::preallocated_object[ - ACE_Object_Manager::ACE_PREALLOCATED_OBJECTS] = { 0 }; - -void *ACE_Object_Manager::preallocated_array[ - ACE_Object_Manager::ACE_PREALLOCATED_ARRAYS] = { 0 }; - // Handy macros for use by ACE_Object_Manager constructor to // preallocate or delete an object or array, either statically (in // global data) or dynamically (on the heap). |