diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index b4e1f998644..8296a753ad9 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -232,14 +232,24 @@ make_list(Iterator begin, Iterator end) # define CGAL_make_list(begin, end) (begin, end) #endif -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) -#define CGAL_DEPRECATED __attribute__((deprecated)) -#elif _MSC_VER > 1300 -#define CGAL_DEPRECATED __declspec(deprecated) + +// Macro to trigger deprecation warnings +#if defined (__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +# define CGAL_DEPRECATED __attribute__((deprecated)) +#elif defined (_MSC_VER) && (_MSC_VER > 1300) +# define CGAL_DEPRECATED __declspec(deprecated) #else -#define CGAL_DEPRECATED +# define CGAL_DEPRECATED #endif +// If CGAL_HAS_THREADS is not defined, then CGAL code assumes +// it can do any thread-unsafe things (like using static variables). +#if !defined CGAL_HAS_THREADS && !defined CGAL_HAS_NO_THREADS + #if defined BOOST_HAS_THREADS || defined _OPENMP + # define CGAL_HAS_THREADS + #endif +#endif + #endif // CGAL_CONFIG_H diff --git a/Manual/doc_tex/Introduction/main.tex b/Manual/doc_tex/Introduction/main.tex index eac11cf8a87..b1444a2442e 100644 --- a/Manual/doc_tex/Introduction/main.tex +++ b/Manual/doc_tex/Introduction/main.tex @@ -154,5 +154,22 @@ Every release of \cgal\ defines the following preprocessor macros: \end{description} +\section{Thread safety} + +\cgal\ is progressively being made thread-safe. The guidelines which are followed +are: +\begin{itemize} +\item it should be possible to use different objects in different threads at +the same time (of the same type or not), +\item it is not safe to access the same object from different threads +at the same time. +\end{itemize} + +If the macro \ccc{CGAL_HAS_THREADS} is not defined, then \cgal\ assumes it can use +any thread-unsafe code (such as static variables). By default, this macro is not +defined, unless \ccc{BOOST_HAS_THREADS} or \ccc{_OPENMP} is defined. It is possible +to force its definition on the command line, and it is possible to prevent its default +definition by setting \ccc{CGAL_HAS_NO_THREADS} from the command line. + \input{Introduction_ref/checks} % extra chapter