MCPcopy Create free account
hub / github.com/baldurk/renderdoc / ThreadEntry

Method ThreadEntry

renderdoc/android/android.cpp:988–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

986 rdcarray<Command *> cmdqueue;
987
988 void ThreadEntry()
989 {
990 Threading::SetCurrentThreadName("AndroidController");
991
992 while(Atomic::CmpExch32(&running, 1, 1) == 1)
993 {
994 Threading::Sleep(5);
995 Command *cmd = NULL;
996
997 {
998 SCOPED_LOCK(lock);
999 if(cmdqueue.empty())
1000 continue;
1001
1002 cmd = cmdqueue[0];
1003 cmdqueue.erase(0);
1004 }
1005
1006 cmd->meth();
1007
1008 if(cmd->selfdelete)
1009 {
1010 delete cmd;
1011 }
1012 else
1013 {
1014 Atomic::Inc32(&cmd->done);
1015 }
1016 }
1017 }
1018
1019 void Invoke(std::function<void()> method)
1020 {

Callers 1

StartMethod · 0.45

Calls 6

SetCurrentThreadNameFunction · 0.85
CmpExch32Function · 0.50
SleepFunction · 0.50
Inc32Function · 0.50
emptyMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected