MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Kill

Method Kill

Source/Engine/Platform/Base/ThreadBase.cpp:43–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void ThreadBase::Kill(bool waitForJoin)
44{
45 if (!_isRunning)
46 {
47 ClearHandleInternal();
48 if (_callAfterWork)
49 {
50 _callAfterWork = false;
51 _runnable->AfterWork(true);
52 }
53 return;
54 }
55 ASSERT(GetID());
56 Thread* thread = (Thread*)this;
57
58 // Stop runnable object
59 if (_callAfterWork && _runnable)
60 {
61 _runnable->Stop();
62 }
63
64 LOG(Info, "Killing thread \'{0}\' ID=0x{1:x}", _name, _id);
65
66 // Kill platform thread
67 KillInternal(waitForJoin);
68 ClearHandleInternal();
69
70 // End
71 if (_callAfterWork)
72 {
73 _callAfterWork = false;
74 _runnable->AfterWork(true);
75 }
76 _isRunning = false;
77 ThreadRegistry::Remove(thread);
78}
79
80int32 ThreadBase::Run()
81{

Callers 5

DisposeMethod · 0.80
KillEmAllMethod · 0.80
DisposeMethod · 0.80
~LoadingThreadMethod · 0.80
DisposeMethod · 0.80

Calls 5

GetIDFunction · 0.85
KillInternalFunction · 0.50
RemoveFunction · 0.50
AfterWorkMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected