MCPcopy Create free account
hub / github.com/carbonengine/trinity / TasksWorker

Function TasksWorker

trinity/Tr2TextureAnimation.cpp:15–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13bool s_initialized = false;
14
15void TasksWorker()
16{
17 for( ;; )
18 {
19 IBlueCallbackMan::CallbackFunc func;
20 void* context;
21 {
22 std::unique_lock lk( s_tasksMutex );
23 s_tasksCV.wait( lk, [] { return !s_tasks.empty(); } );
24 func = s_tasks[0].first;
25 context = s_tasks[0].second;
26 s_tasks.erase( s_tasks.begin() );
27 }
28
29 ( *func )( context );
30 }
31}
32
33void AddToComputeQueue( IBlueCallbackMan::CallbackFunc pCb, void* pContext )
34{

Callers

nothing calls this directly

Calls 3

waitMethod · 0.80
emptyMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected