MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / ~AsyncJob

Method ~AsyncJob

framework/utils/AsyncJob.cpp:26–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 AsyncJob::~AsyncJob()
27 {
28 AsyncJobLive = 0;
29#ifdef WIN32
30 mThread->forceStop();
31#endif
32 delete mThread;
33
34 while (!mJobItems.empty()) {
35 std::function<void()> func = mJobItems.front();
36 func();
37 mJobItems.pop();
38 }
39
40 int64_t currentTime = af_getsteady_ms();
41 while (!mDelayJobItems.empty()) {
42 const DelayJobItem &jobItem = mDelayJobItems.front();
43 if (currentTime >= jobItem.mRunTime) {
44 if (jobItem.mFunc) {
45 jobItem.mFunc();
46 }
47 mDelayJobItems.pop_front();
48 } else {
49 break;
50 }
51 }
52 }
53
54 AsyncJob *AsyncJob::Instance(void)
55 {

Callers

nothing calls this directly

Calls 5

af_getsteady_msFunction · 0.85
forceStopMethod · 0.80
frontMethod · 0.80
emptyMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected