MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / waitForAllItems

Method waitForAllItems

Engine/source/platform/threads/threadPool.cpp:435–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435void ThreadPool::waitForAllItems( S32 timeOut )
436{
437 U32 endTime = 0;
438 if( timeOut != -1 )
439 endTime = Platform::getRealMilliseconds() + timeOut;
440
441 // Spinlock until there are no items that have not been processed.
442
443 while( dAtomicRead( mNumPendingItems ) )
444 {
445 Platform::sleep( 25 );
446
447 // Stop if we have exceeded our processing time budget.
448
449 if( timeOut != -1
450 && Platform::getRealMilliseconds() >= endTime )
451 break;
452 }
453}
454
455//--------------------------------------------------------------------------
456

Callers 2

ddsCompressFunction · 0.80
TEST_FIXFunction · 0.80

Calls 1

dAtomicReadFunction · 0.50

Tested by 1

TEST_FIXFunction · 0.64