diff options
Diffstat (limited to 'sal/osl/unx/thread.cxx')
-rw-r--r-- | sal/osl/unx/thread.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx index 5ea77495daa6..fb694ebd92cd 100644 --- a/sal/osl/unx/thread.cxx +++ b/sal/osl/unx/thread.cxx @@ -75,6 +75,8 @@ #define THREADIMPL_FLAGS_ATTACHED 0x00010 #define THREADIMPL_FLAGS_DESTROYED 0x00020 +namespace { + typedef struct osl_thread_impl_st { pthread_t m_hThread; @@ -95,18 +97,26 @@ struct osl_thread_priority_st int m_Lowest; }; +} + #define OSL_THREAD_PRIORITY_INITIALIZER { 127, 96, 64, 32, 0 } static void osl_thread_priority_init_Impl(); +namespace { + struct osl_thread_textencoding_st { pthread_key_t m_key; /* key to store thread local text encoding */ rtl_TextEncoding m_default; /* the default text encoding */ }; +} + #define OSL_THREAD_TEXTENCODING_INITIALIZER { 0, RTL_TEXTENCODING_DONTKNOW } static void osl_thread_textencoding_init_Impl(); +namespace { + struct osl_thread_global_st { pthread_once_t m_once; @@ -114,6 +124,8 @@ struct osl_thread_global_st struct osl_thread_textencoding_st m_textencoding; }; +} + static struct osl_thread_global_st g_thread = { PTHREAD_ONCE_INIT, @@ -555,6 +567,8 @@ void SAL_CALL osl_setThreadName(char const * name) /* osl_getThreadIdentifier @@@ see TODO @@@ */ +namespace { + struct HashEntry { pthread_t Handle; @@ -562,6 +576,8 @@ struct HashEntry HashEntry * Next; }; +} + static HashEntry* HashTable[31]; static const int HashSize = SAL_N_ELEMENTS(HashTable); @@ -951,12 +967,16 @@ oslThreadPriority SAL_CALL osl_getThreadPriority(const oslThread Thread) return Priority; } +namespace { + struct wrapper_pthread_key { pthread_key_t m_key; oslThreadKeyCallbackFunction pfnCallback; }; +} + oslThreadKey SAL_CALL osl_createThreadKey( oslThreadKeyCallbackFunction pCallback ) { wrapper_pthread_key *pKey = static_cast<wrapper_pthread_key*>(malloc(sizeof(wrapper_pthread_key))); |