Use <mutex> starting with Visual 2012 and g++ 4.8 with std=c++11

This commit is contained in:
Andreas Fabri 2015-10-05 12:19:13 +02:00
parent adf615c427
commit ca54af03c2
2 changed files with 7 additions and 1 deletions

View File

@ -424,6 +424,12 @@ using std::max;
#define CGAL_CAN_USE_CXX11_THREAD_LOCAL
#endif
#if ( defined(__GNUC__) && defined(__GNUC_MINOR__) \
&& (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 \
&& __cplusplus >= 201103L ) || ( _MSC_VER >= 1700 )
#define CGAL_CAN_USE_CXX11_MUTEX
#endif
// Support for LEDA with threads
// Not that, if CGAL_HAS_THREADS is defined, and you want to use LEDA,
// you must link with a version of LEDA libraries that support threads.

View File

@ -4,7 +4,7 @@
#include <CGAL/config.h>
#ifdef CGAL_HAS_THREADS
#ifdef BOOST_MSVC
#ifdef CGAL_CAN_USE_CXX11_MUTEX
#include <mutex>
#define CGAL_MUTEX std::mutex
#define CGAL_SCOPED_LOCK(M) std::unique_lock<std::mutex> scoped_lock(M)