| 584 | return m_numThreads; |
| 585 | } |
| 586 | virtual void setNumThreads(int numThreads) BT_OVERRIDE |
| 587 | { |
| 588 | m_numThreads = (std::max)(1, (std::min)(int(BT_MAX_THREAD_COUNT), numThreads)); |
| 589 | if (m_tbbSchedulerInit) |
| 590 | { |
| 591 | // destroys all previous threads |
| 592 | delete m_tbbSchedulerInit; |
| 593 | m_tbbSchedulerInit = NULL; |
| 594 | } |
| 595 | m_tbbSchedulerInit = new tbb::task_scheduler_init(m_numThreads); |
| 596 | m_savedThreadCounter = 0; |
| 597 | if (m_isActive) |
| 598 | { |
| 599 | btResetThreadIndexCounter(); |
| 600 | } |
| 601 | } |
| 602 | struct ForBodyAdapter |
| 603 | { |
| 604 | const btIParallelForBody* mBody; |
no test coverage detected