| 394 | } |
| 395 | |
| 396 | void OSExitThread(void *val) |
| 397 | { |
| 398 | OSThread *thread; |
| 399 | BOOL enable; |
| 400 | |
| 401 | enable = OSDisableInterrupts(); |
| 402 | thread = __OSCurrentThread; |
| 403 | OSClearContext(&thread->context); |
| 404 | |
| 405 | if (thread->attr & OS_THREAD_ATTR_DETACH) |
| 406 | { |
| 407 | RemoveItem(&__OSActiveThreadQueue, thread, linkActive); |
| 408 | thread->state = OS_THREAD_STATE_NULL; |
| 409 | } |
| 410 | else |
| 411 | { |
| 412 | thread->state = OS_THREAD_STATE_MORIBUND; |
| 413 | thread->val = val; |
| 414 | } |
| 415 | |
| 416 | __OSUnlockAllMutex(thread); |
| 417 | OSWakeupThread(&thread->queueJoin); |
| 418 | RunQueueHint = TRUE; |
| 419 | if (RunQueueHint != FALSE) |
| 420 | { |
| 421 | SelectThread(FALSE); |
| 422 | } |
| 423 | |
| 424 | OSRestoreInterrupts(enable); |
| 425 | } |
| 426 | |
| 427 | void OSCancelThread(OSThread* thread) { |
| 428 | BOOL enabled; |
no test coverage detected