| 166 | } |
| 167 | |
| 168 | unsigned 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 | |
| 194 | void nthread_cleanup() |
| 195 | { |
nothing calls this directly
no test coverage detected