diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index 32f26eb43ef..998064153ea 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -28,6 +28,7 @@ #include #ifdef CGAL_HAS_THREADS +#warning USING THEADS #include #endif @@ -221,12 +222,14 @@ namespace CGAL { #endif const Node* root_node() const { - #ifdef CGAL_HAS_THREADS - //this ensure that build() will be called once - boost::mutex::scoped_lock scoped_lock(internal_tree_mutex); - #endif - if(m_need_build) - const_cast< AABB_tree* >(this)->build(); + if(m_need_build){ + #ifdef CGAL_HAS_THREADS + //this ensure that build() will be called once + boost::mutex::scoped_lock scoped_lock(internal_tree_mutex); + if(m_need_build) + #endif + const_cast< AABB_tree* >(this)->build(); + } return m_p_root_node; }