Add support for Solaris thread library.
From-SVN: r25028
This commit is contained in:
parent
b76354a542
commit
7fccd11028
@ -58,7 +58,8 @@
|
||||
# define __RESTRICT
|
||||
#endif
|
||||
|
||||
#if !defined(__STL_PTHREADS) && !defined(_NOTHREADS) \
|
||||
#if !defined(__STL_PTHREADS) && !defined(__STL_SOLTHREADS) \
|
||||
&& !defined(_NOTHREADS) \
|
||||
&& !defined(__STL_SGI_THREADS) && !defined(__STL_WIN32THREADS)
|
||||
# define _NOTHREADS
|
||||
#endif
|
||||
@ -75,6 +76,15 @@
|
||||
# define __NODE_ALLOCATOR_THREADS true
|
||||
# define __VOLATILE volatile // Needed at -O3 on SGI
|
||||
# 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
|
||||
// The lock needs to be initialized by constructing an allocator
|
||||
// objects of the right type. We do that here explicitly for alloc.
|
||||
@ -358,6 +368,10 @@ private:
|
||||
static pthread_mutex_t _S_node_allocator_lock;
|
||||
# endif
|
||||
|
||||
# ifdef __STL_SOLTHREADS
|
||||
static mutex_t _S_node_allocator_lock;
|
||||
# endif
|
||||
|
||||
# ifdef __STL_WIN32THREADS
|
||||
static CRITICAL_SECTION _S_node_allocator_lock;
|
||||
static bool _S_node_allocator_lock_initialized;
|
||||
@ -567,6 +581,13 @@ __default_alloc_template<threads, inst>::reallocate(void* __p,
|
||||
= PTHREAD_MUTEX_INITIALIZER;
|
||||
#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
|
||||
template <bool __threads, int __inst>
|
||||
CRITICAL_SECTION
|
||||
|
Loading…
Reference in New Issue
Block a user