MCPcopy Create free account
hub / github.com/crossuo/crossuo / THREADCALL CThreadLoop

Function THREADCALL CThreadLoop

src/Wisp/WispThread.cpp:17–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15namespace Wisp
16{
17thread_int THREADCALL CThreadLoop(void *arg)
18{
19 CThread *parent = (CThread *)arg;
20
21 while (parent->IsActive())
22 {
23 while (parent->Paused())
24 {
25 SDL_Delay(1);
26 }
27
28#if THREAD_USE_CLOCK == 1
29 parent->OnExecute(clock());
30#else
31 parent->OnExecute(SDL_GetTicks());
32#endif
33
34 if (!parent->Cycled())
35 {
36 break;
37 }
38
39 int delay = parent->Delay();
40
41 if (delay > 0)
42 {
43 SDL_Delay(delay);
44 }
45 }
46
47 parent->OnDestroy();
48 delete parent;
49
50 return 0;
51};
52
53thread_int THREADCALL CThreadLoopSynchronizedDelay(void *arg)
54{

Callers

nothing calls this directly

Calls 8

PausedMethod · 0.80
CycledMethod · 0.80
DelayMethod · 0.80
SDL_DelayFunction · 0.50
SDL_GetTicksFunction · 0.50
IsActiveMethod · 0.45
OnExecuteMethod · 0.45
OnDestroyMethod · 0.45

Tested by

no test coverage detected