MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / start

Method start

modules/core/task/src/task2.cpp:161–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159 {
160
161 void start()
162 {
163 if(!isMainThread)
164 {
165 desc = make_zeroed<SThreadDesc>();
166 desc.pData = this;
167 desc.pFunc = +[](void* pData)
168 {
169 Worker* pWorker = (Worker*)pData;
170 set_instance(pWorker->scheduler);
171 currentWorker = pWorker;
172 {
173 SMutexLock lock(pWorker->work.mutex);
174 pWorker->run();
175 }
176 currentWorker = nullptr;
177 set_instance(nullptr);
178 };
179 skr_init_thread(&desc, &handle);
180 }
181 else
182 {
183 //do nothing
184 }
185 }
186
187 void signalStop()
188 {

Callers 1

initializeMethod · 0.45

Calls 3

set_instanceFunction · 0.85
skr_init_threadFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected