| 508 | return m_numThreads; |
| 509 | } |
| 510 | virtual void setNumThreads(int numThreads) BT_OVERRIDE |
| 511 | { |
| 512 | // With OpenMP, because it is a standard with various implementations, we can't |
| 513 | // know for sure if every implementation has the same behavior of destroying all |
| 514 | // previous threads when resizing the threadpool |
| 515 | m_numThreads = (std::max)(1, (std::min)(int(BT_MAX_THREAD_COUNT), numThreads)); |
| 516 | omp_set_num_threads(1); // hopefully, all previous threads get destroyed here |
| 517 | omp_set_num_threads(m_numThreads); |
| 518 | m_savedThreadCounter = 0; |
| 519 | if (m_isActive) |
| 520 | { |
| 521 | btResetThreadIndexCounter(); |
| 522 | } |
| 523 | } |
| 524 | virtual void parallelFor(int iBegin, int iEnd, int grainSize, const btIParallelForBody& body) BT_OVERRIDE |
| 525 | { |
| 526 | BT_PROFILE("parallelFor_OpenMP"); |
nothing calls this directly
no test coverage detected