================== Sys_DestroyThread ================== */
| 298 | ================== |
| 299 | */ |
| 300 | void Sys_DestroyThread(xthreadInfo& info) { |
| 301 | assert(info.threadHandle); |
| 302 | |
| 303 | SDL_WaitThread(info.threadHandle, NULL); |
| 304 | |
| 305 | info.name = NULL; |
| 306 | info.threadHandle = NULL; |
| 307 | info.threadId = 0; |
| 308 | |
| 309 | Sys_EnterCriticalSection(); |
| 310 | |
| 311 | for (int i = 0; i < thread_count; i++) { |
| 312 | if (&info == thread[i]) { |
| 313 | thread[i] = NULL; |
| 314 | |
| 315 | int j; |
| 316 | for (j = i + 1; j < thread_count; j++) |
| 317 | thread[j - 1] = thread[j]; |
| 318 | |
| 319 | thread[j - 1] = NULL; |
| 320 | thread_count--; |
| 321 | |
| 322 | break; |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | Sys_LeaveCriticalSection( ); |
| 327 | } |
| 328 | |
| 329 | /* |
| 330 | ================== |
no test coverage detected