summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-10-30 16:06:57 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-10-30 16:06:57 +0000
commitf4e31c68c84976aea0bdb2f625edff1b1b3cef19 (patch)
treef34f407e7feb34a495d9c866d484292dbb59eda7
parent6639739ad7dded6fa3b19a18109df5d570bed8bc (diff)
downloadATCD-f4e31c68c84976aea0bdb2f625edff1b1b3cef19.tar.gz
(tss_open,tss_close): removed tss_open () dynamic allocation option, and tss_close()
-rw-r--r--ace/OS.cpp29
-rw-r--r--ace/OS.h13
-rw-r--r--ace/Object_Manager.cpp5
3 files changed, 6 insertions, 41 deletions
diff --git a/ace/OS.cpp b/ace/OS.cpp
index 0e3a629a22c..44e6381c975 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -1357,16 +1357,8 @@ ACE_TSS_Emulation::tss_open (void *ts_storage[ACE_TSS_THREAD_KEYS_MAX])
{
if (tss_base () == 0)
{
- if (ts_storage == 0)
- {
- // Allocate an array off the heap for this thread's TSS.
- ACE_NEW_RETURN (tss_base (), void *[ACE_TSS_THREAD_KEYS_MAX], 0);
- }
- else
- {
- // Use the supplied array for this thread's TSS.
- tss_base () = ts_storage;
- }
+ // Use the supplied array for this thread's TSS.
+ tss_base () = ts_storage;
// Zero the entire TSS array. Do it manually instead of using
// memset, for optimum speed.
@@ -1382,17 +1374,6 @@ ACE_TSS_Emulation::tss_open (void *ts_storage[ACE_TSS_THREAD_KEYS_MAX])
}
}
-void
-ACE_TSS_Emulation::tss_close (void *ts_storage[ACE_TSS_THREAD_KEYS_MAX])
-{
- if (ts_storage == 0)
- {
- // ts_storage had been dynamically allocated, so delete it.
- delete [] tss_base ();
- tss_base () = 0;
- }
-}
-
#if !defined (VXWORKS)
// FOR TESTING ONLY!
void **
@@ -1523,12 +1504,6 @@ ACE_Thread_Adapter::invoke (void)
ACE_OS::cleanup_tss (0 /* not main thread */);
#endif /* ACE_WIN32 || ACE_HAS_TSS_EMULATION */
-#if defined (ACE_HAS_TSS_EMULATION)
- // Close the thread's local TS storage. The argument just needs to
- // be non-zero so that tss_close doesn't delete the storage.
- ACE_TSS_Emulation::tss_close ((void **) 1);
-#endif /* ACE_HAS_TSS_EMULATION */
-
# if defined (ACE_WIN32) && defined (ACE_HAS_MFC) && (ACE_HAS_MFC != 0)
// Exit the thread.
// Allow CWinThread-destructor to be invoked from AfxEndThread.
diff --git a/ace/OS.h b/ace/OS.h
index 17139a1023c..a128cbebb8d 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -4306,15 +4306,10 @@ public:
// Accesses the object referenced by key in the current thread's TSS array.
// Does _not_ check for a valid key.
- static void *tss_open (void *ts_storage[ACE_TSS_THREAD_KEYS_MAX] = 0);
- // Setup an array to be used for local TSS. If the argument is 0,
- // an array is allocated off the heap. Returns the array address,
- // or 0 if allocation is attempted and fails, or if local TSS had
- // already been setup for this thread.
-
- static void tss_close (void *ts_storage[ACE_TSS_THREAD_KEYS_MAX] = 0);
- // Finish using an array for local TSS. If the argument is 0,
- // then the array this is currently be used is deleted from heap storage.
+ static void *tss_open (void *ts_storage[ACE_TSS_THREAD_KEYS_MAX]);
+ // Setup an array to be used for local TSS. Returns the array address on
+ // success. Returns 0 if local TSS had already been setup for this thread.
+ // There is no corresponding tss_close () because it is not needed.
private:
// Global TSS structures.
diff --git a/ace/Object_Manager.cpp b/ace/Object_Manager.cpp
index 19cf1808aa8..b20e7e6619a 100644
--- a/ace/Object_Manager.cpp
+++ b/ace/Object_Manager.cpp
@@ -510,11 +510,6 @@ ACE_Object_Manager::~ACE_Object_Manager (void)
// Close the ACE_Allocator.
ACE_Allocator::close_singleton ();
-#if defined (ACE_HAS_TSS_EMULATION)
- // Close the thread's local TS storage.
- ACE_TSS_Emulation::tss_close (ts_storage_);
-#endif /* ACE_HAS_TSS_EMULATION */
-
#if ! defined (ACE_HAS_STATIC_PREALLOCATION)
// Hooks for deletion of preallocated objects and arrays provided by
// application.