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

Method process

Engine/source/platform/async/asyncUpdate.cpp:31–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29//-----------------------------------------------------------------------------
30
31void AsyncUpdateList::process( S32 timeOut )
32{
33 U32 endTime = 0;
34 if( timeOut != -1 )
35 endTime = Platform::getRealMilliseconds() + timeOut;
36
37 // Flush the process list.
38
39 IPolled* ptr;
40 IPolled* firstProcessedPtr = 0;
41
42 while( mUpdateList.tryPopFront( ptr ) )
43 {
44 if( ptr == firstProcessedPtr )
45 {
46 // We've wrapped around. Stop.
47
48 mUpdateList.pushFront( ptr );
49 break;
50 }
51
52 if( ptr->update() )
53 {
54 mUpdateList.pushBack( ptr );
55
56 if( !firstProcessedPtr )
57 firstProcessedPtr = ptr;
58 }
59
60 // Stop if we have exceeded our processing time budget.
61
62 if( timeOut != -1
63 && Platform::getRealMilliseconds() >= endTime )
64 break;
65 }
66}
67
68//--------------------------------------------------------------------------
69// AsyncUpdateThread implementation.

Callers 1

runMethod · 0.45

Calls 4

tryPopFrontMethod · 0.45
pushFrontMethod · 0.45
updateMethod · 0.45
pushBackMethod · 0.45

Tested by

no test coverage detected