Commit 7fccd110 by Ulrich Drepper

Add support for Solaris thread library.

From-SVN: r25028
parent b76354a5
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
# define __RESTRICT # define __RESTRICT
#endif #endif
#if !defined(__STL_PTHREADS) && !defined(_NOTHREADS) \ #if !defined(__STL_PTHREADS) && !defined(__STL_SOLTHREADS) \
&& !defined(_NOTHREADS) \
&& !defined(__STL_SGI_THREADS) && !defined(__STL_WIN32THREADS) && !defined(__STL_SGI_THREADS) && !defined(__STL_WIN32THREADS)
# define _NOTHREADS # define _NOTHREADS
#endif #endif
...@@ -75,6 +76,15 @@ ...@@ -75,6 +76,15 @@
# define __NODE_ALLOCATOR_THREADS true # define __NODE_ALLOCATOR_THREADS true
# define __VOLATILE volatile // Needed at -O3 on SGI # define __VOLATILE volatile // Needed at -O3 on SGI
# endif # endif
# ifdef __STL_SOLTHREADS
# include <thread.h>
# define __NODE_ALLOCATOR_LOCK \
if (threads) mutex_lock(&_S_node_allocator_lock)
# define __NODE_ALLOCATOR_UNLOCK \
if (threads) mutex_unlock(&_S_node_allocator_lock)
# define __NODE_ALLOCATOR_THREADS true
# define __VOLATILE
# endif
# ifdef __STL_WIN32THREADS # ifdef __STL_WIN32THREADS
// The lock needs to be initialized by constructing an allocator // The lock needs to be initialized by constructing an allocator
// objects of the right type. We do that here explicitly for alloc. // objects of the right type. We do that here explicitly for alloc.
...@@ -358,6 +368,10 @@ private: ...@@ -358,6 +368,10 @@ private:
static pthread_mutex_t _S_node_allocator_lock; static pthread_mutex_t _S_node_allocator_lock;
# endif # endif
# ifdef __STL_SOLTHREADS
static mutex_t _S_node_allocator_lock;
# endif
# ifdef __STL_WIN32THREADS # ifdef __STL_WIN32THREADS
static CRITICAL_SECTION _S_node_allocator_lock; static CRITICAL_SECTION _S_node_allocator_lock;
static bool _S_node_allocator_lock_initialized; static bool _S_node_allocator_lock_initialized;
...@@ -567,6 +581,13 @@ __default_alloc_template<threads, inst>::reallocate(void* __p, ...@@ -567,6 +581,13 @@ __default_alloc_template<threads, inst>::reallocate(void* __p,
= PTHREAD_MUTEX_INITIALIZER; = PTHREAD_MUTEX_INITIALIZER;
#endif #endif
#ifdef __STL_SOLTHREADS
template <bool __threads, int __inst>
mutex_t
__default_alloc_template<__threads, __inst>::_S_node_allocator_lock
= DEFAULTMUTEX;
#endif
#ifdef __STL_WIN32THREADS #ifdef __STL_WIN32THREADS
template <bool __threads, int __inst> template <bool __threads, int __inst>
CRITICAL_SECTION CRITICAL_SECTION
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment