| 251 | } |
| 252 | |
| 253 | void PointsPrimitiveEvaluator::buildTree() |
| 254 | { |
| 255 | if( m_haveTree ) |
| 256 | { |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | std::lock_guard<TreeMutex> lock( m_treeMutex ); |
| 261 | if( m_haveTree ) |
| 262 | { |
| 263 | // another thread may have built the tree while we waited for the mutex |
| 264 | return; |
| 265 | } |
| 266 | |
| 267 | m_tree.init( m_pVector->begin(), m_pVector->end() ); |
| 268 | m_haveTree = true; |
| 269 | } |
no test coverage detected