4 extern void __exit_thread(void);
5 typedef void (*func_ptr
)(void);
7 void kill_thread(struct thread
*thread
)
10 struct thread_block
*block
;
12 if (thread
== current())
18 * Muck with the stack so that the next time the thread is run then
19 * we end up going to __exit_thread.
21 thread
->esp
->eip
= __exit_thread
;
22 thread
->prio
= INT_MIN
;
24 block
= thread
->blocked
;
26 struct semaphore
*sem
= block
->semaphore
;
27 /* Remove us from the queue and increase the count */
28 block
->list
.next
->prev
= block
->list
.prev
;
29 block
->list
.prev
->next
= block
->list
.next
;
32 thread
->blocked
= NULL
;
33 block
->timed_out
= true; /* Fake an immediate timeout */