MCPcopy Create free account
hub / github.com/beefytech/Beef / SlowGetCurThreadInfo

Method SlowGetCurThreadInfo

BeefySysLib/util/BeefPerf.cpp:844–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842}
843
844BpThreadInfo* BpManager::SlowGetCurThreadInfo()
845{
846 BfpThreadId curThreadId = BfpThread_GetCurrentId();
847 // Try to find an existing one
848 {
849 AutoCrit autoCrit(mCritSect);
850 for (auto threadInfo : mThreadInfos)
851 if (threadInfo->mNativeThreadId == curThreadId)
852 return threadInfo;
853 }
854
855 auto threadInfo = new BpThreadInfo();
856 threadInfo->mThreadId = mCurThreadId++;
857 threadInfo->mNativeThreadId = curThreadId;
858 sBpThreadInfo = threadInfo;
859
860 AutoCrit autoCrit(mCritSect);
861 mThreadInfos.push_back(threadInfo);
862
863 if (mThreadRunning)
864 mRootCmdTarget.AddThread(threadInfo->mThreadId, threadInfo->mNativeThreadId);
865
866 mTLSDtor.Add((void*)threadInfo);
867
868 return threadInfo;
869}
870
871void* BpManager::AllocBytes(int size)
872{

Callers 1

GetCurThreadInfoMethod · 0.80

Calls 4

AddThreadMethod · 0.80
BfpThread_GetCurrentIdFunction · 0.50
push_backMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected