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

Method Finish

IDEHelper/Compiler/BfCodeGen.cpp:1015–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1013}
1014
1015bool BfCodeGen::Finish()
1016{
1017 BP_ZONE("BfCodeGen::Finish");
1018
1019 while (mRequests.size() != 0)
1020 {
1021 auto request = mRequests[0];
1022 if (request->mResult.mType == BfCodeGenResult_NotDone)
1023 {
1024 bool hasRunningThreads = false;
1025 for (auto thread : mThreads)
1026 {
1027 if (thread->mRunning)
1028 hasRunningThreads = true;
1029 }
1030 if (!hasRunningThreads)
1031 {
1032 mPendingRequests.Clear();
1033 request->mResult.mType = BfCodeGenResult_Aborted;
1034 continue;
1035 }
1036
1037 mDoneEvent.WaitFor(20);
1038 continue;
1039 }
1040
1041 RequestComplete(request);
1042 delete request;
1043 mRequests.RemoveAt(0);
1044 return false;
1045 }
1046
1047 if (mIsUsingReleaseThunk)
1048 {
1049 // Make the thunk release its threads (and more important, its LLVM contexts)
1050 mFinishFunc();
1051 }
1052
1053 // We need to shut down these threads to remove their memory
1054 for (auto thread : mThreads)
1055 {
1056 thread->mShuttingDown = true;
1057 mOldThreads.push_back(thread);
1058 }
1059 mThreads.Clear();
1060 mRequestEvent.Set(true);
1061
1062 ClearOldThreads(false);
1063
1064// for (auto request : mPendingRequests)
1065// {
1066// if (request->mExternResultPtr != NULL)
1067// {
1068// request->mExternResultPtr->mType = BfCodeGenResult_Aborted;
1069// //delete request;
1070// }
1071// //request->mResult.mType = BfCodeGenResult_Aborted;
1072// //delete request;

Callers 1

BfCodeGen_FinishFunction · 0.45

Calls 8

WaitForMethod · 0.80
sizeMethod · 0.45
ClearMethod · 0.45
RemoveAtMethod · 0.45
push_backMethod · 0.45
SetMethod · 0.45
WriteMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected