Boost logo

Boost-Commit :

From: hartmut.kaiser_at_[hidden]
Date: 2007-10-05 14:49:03


Author: hkaiser
Date: 2007-10-05 14:48:56 EDT (Fri, 05 Oct 2007)
New Revision: 39716
URL: http://svn.boost.org/trac/boost/changeset/39716

Log:
Pool: Added detection of availability of pthreads using the BOOST_HAS_PTHREADS constant.
Text files modified:
   trunk/boost/pool/detail/mutex.hpp | 12 +++++++-----
   1 files changed, 7 insertions(+), 5 deletions(-)

Modified: trunk/boost/pool/detail/mutex.hpp
==============================================================================
--- trunk/boost/pool/detail/mutex.hpp (original)
+++ trunk/boost/pool/detail/mutex.hpp 2007-10-05 14:48:56 EDT (Fri, 05 Oct 2007)
@@ -30,8 +30,10 @@
   #ifdef BOOST_WINDOWS
     #define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_WIN32
   #else
- #include <unistd.h>
- #ifdef _POSIX_THREADS
+ #if defined(BOOST_HAS_UNISTD_H)
+ #include <unistd.h>
+ #endif
+ #if defined(_POSIX_THREADS) || defined(BOOST_HAS_PTHREADS)
       #define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_PTHREAD
     #endif
   #endif
@@ -45,7 +47,7 @@
 # ifdef BOOST_WINDOWS
 # include <windows.h>
 # endif
-# ifdef _POSIX_THREADS
+# if defined(_POSIX_THREADS) || defined(BOOST_HAS_PTHREADS)
 # include <pthread.h>
 # endif
 #endif
@@ -83,7 +85,7 @@
 
 #endif // defined(BOOST_WINDOWS)
 
-#ifdef _POSIX_THREADS
+#if defined(_POSIX_THREADS) || defined(BOOST_HAS_PTHREADS)
 
 class pthread_mutex
 {
@@ -107,7 +109,7 @@
     { pthread_mutex_unlock(&mtx); }
 };
 
-#endif // defined(_POSIX_THREADS)
+#endif // defined(_POSIX_THREADS) || defined(BOOST_HAS_PTHREADS)
 
 #endif // !defined(BOOST_NO_MT)
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk