MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / setNumThreads

Method setNumThreads

src/LinearMath/btThreads.cpp:586–601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 2

addTaskSchedulerMethod · 0.45
setNumThreadsFunction · 0.45

Calls 1

Tested by

no test coverage detected