MCPcopy Create free account
hub / github.com/diasurgical/devilution / nthread_handler

Function nthread_handler

Source/nthread.cpp:168–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168unsigned int nthread_handler(void *)
169{
170 int delta;
171 BOOL received;
172
173 if (nthread_should_run) {
174 while (1) {
175 sgMemCrit.Enter();
176 if (!nthread_should_run)
177 break;
178 nthread_send_and_recv_turn(0, 0);
179 if (nthread_recv_turns(&received))
180 delta = last_tick - SDL_GetTicks();
181 else
182 delta = 50;
183 sgMemCrit.Leave();
184 if (delta > 0)
185 SDL_Delay(delta);
186 if (!nthread_should_run)
187 return 0;
188 }
189 sgMemCrit.Leave();
190 }
191 return 0;
192}
193
194void nthread_cleanup()
195{

Callers

nothing calls this directly

Calls 4

nthread_recv_turnsFunction · 0.85
EnterMethod · 0.80
LeaveMethod · 0.80

Tested by

no test coverage detected