summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/threadpool/thread.cxx8
-rw-r--r--cppu/source/threadpool/threadident.cxx42
2 files changed, 18 insertions, 32 deletions
diff --git a/cppu/source/threadpool/thread.cxx b/cppu/source/threadpool/thread.cxx
index 9d006ff142f2..3ff7d10b3973 100644
--- a/cppu/source/threadpool/thread.cxx
+++ b/cppu/source/threadpool/thread.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: thread.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 15:25:52 $
+ * last change: $Author: jbu $ $Date: 2000-09-29 12:42:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -127,9 +127,6 @@ namespace cppu_threadpool {
delete this;
}
- // hack during no proper threadlocalstorage support
- void SAL_CALL destructCurrentId();
-
void ORequestThread::run()
{
while ( m_pQueue )
@@ -165,6 +162,5 @@ namespace cppu_threadpool {
cppu_threadpool::ThreadPool::getInstance()->waitInPool( this );
}
- destructCurrentId();
}
}
diff --git a/cppu/source/threadpool/threadident.cxx b/cppu/source/threadpool/threadident.cxx
index cedf69b6e869..4bbce71cddb5 100644
--- a/cppu/source/threadpool/threadident.cxx
+++ b/cppu/source/threadpool/threadident.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: threadident.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 15:25:52 $
+ * last change: $Author: jbu $ $Date: 2000-09-29 12:42:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,6 +94,19 @@ struct IdContainer
}
using namespace cppu_threadpool;
+static void SAL_CALL destructIdContainer( void *p )
+{
+ fprintf( stderr, "destructIdContainer called\n" );
+ if( p )
+ {
+ IdContainer *pId = (IdContainer * ) p;
+ rtl_byte_sequence_release( pId->pLocalThreadId );
+ rtl_byte_sequence_release( pId->pCurrentId );
+ rtl_freeMemory( p );
+ fprintf( stderr, "id freed\n" );
+ }
+}
+
static inline oslThreadKey getKey()
{
if( ! g_bInitialized )
@@ -101,7 +114,7 @@ static inline oslThreadKey getKey()
::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() );
if( ! g_bInitialized )
{
- g_key = osl_createThreadKey();
+ g_key = osl_createThreadKey( destructIdContainer );
g_bInitialized = sal_True;
}
}
@@ -117,29 +130,6 @@ static inline void createLocalId( sal_Sequence **ppThreadId )
}
-static void SAL_CALL destructIdContainer( void *p )
-{
- if( p )
- {
- IdContainer *pId = (IdContainer * ) p;
- rtl_byte_sequence_release( pId->pLocalThreadId );
- rtl_byte_sequence_release( pId->pCurrentId );
- rtl_freeMemory( p );
- }
-}
-
-
-//--------------------------------------------------------
-// private hack as long as no proper threadlocal storage is provided
-//--------------------------------------------------------
-namespace cppu_threadpool {
-void SAL_CALL destructCurrentId()
-{
- destructIdContainer( osl_getThreadKeyData( getKey() ) );
-}
-}
-
-
extern "C" SAL_DLLEXPORT void SAL_CALL
uno_getIdOfCurrentThread( sal_Sequence **ppThreadId )
{