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

Method waitForAllItems

Engine/source/platform/threads/threadPool.cpp:447–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447void ThreadPool::waitForAllItems( S32 timeOut )
448{
449 U32 endTime = 0;
450 if( timeOut != -1 )
451 endTime = Platform::getRealMilliseconds() + timeOut;
452
453 // Spinlock until there are no items that have not been processed.
454
455 while( dAtomicRead( mNumPendingItems ) )
456 {
457 Platform::sleep( 25 );
458
459 // Stop if we have exceeded our processing time budget.
460
461 if( timeOut != -1
462 && Platform::getRealMilliseconds() >= endTime )
463 break;
464 }
465}
466
467//--------------------------------------------------------------------------
468

Callers 1

TEST_FIXFunction · 0.80

Calls 1

dAtomicReadFunction · 0.50

Tested by 1

TEST_FIXFunction · 0.64