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

Function btParallelFor

src/LinearMath/btThreads.cpp:412–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412void btParallelFor(int iBegin, int iEnd, int grainSize, const btIParallelForBody& body)
413{
414#if BT_THREADSAFE
415
416#if BT_DETECT_BAD_THREAD_INDEX
417 if (!btThreadsAreRunning())
418 {
419 // clear out thread ids
420 for (int i = 0; i < BT_MAX_THREAD_COUNT; ++i)
421 {
422 gDebugThreadIds[i] = kInvalidThreadId;
423 }
424 }
425#endif // #if BT_DETECT_BAD_THREAD_INDEX
426
427 btAssert(gBtTaskScheduler != NULL); // call btSetTaskScheduler() with a valid task scheduler first!
428 gBtTaskScheduler->parallelFor(iBegin, iEnd, grainSize, body);
429
430#else // #if BT_THREADSAFE
431
432 // non-parallel version of btParallelFor
433 btAssert(!"called btParallelFor in non-threadsafe build. enable BT_THREADSAFE");
434 body.forLoop(iBegin, iEnd);
435
436#endif // #if BT_THREADSAFE
437}
438
439btScalar btParallelSum(int iBegin, int iEnd, int grainSize, const btIParallelSumBody& body)
440{

Calls 3

btThreadsAreRunningFunction · 0.85
parallelForMethod · 0.45
forLoopMethod · 0.45

Tested by

no test coverage detected