aboutsummaryrefslogtreecommitdiff
path: root/chopstx.c
diff options
context:
space:
mode:
Diffstat (limited to 'chopstx.c')
-rw-r--r--chopstx.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/chopstx.c b/chopstx.c
index 07d9854..7868ae2 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -232,9 +232,6 @@ static struct chx_queue q_ready;
/* Queue of threads waiting for timer. */
static struct chx_queue q_timer;
-/* Queue of threads which have been exited. */
-static struct chx_queue q_exit;
-
/* Queue of threads which wait exit of some thread. */
static struct chx_queue q_join;
@@ -631,7 +628,6 @@ chx_init (struct chx_thread *tp)
memset (&tp->tc, 0, sizeof (tp->tc));
q_ready.next = q_ready.prev = (struct chx_thread *)&q_ready;
q_timer.next = q_timer.prev = (struct chx_thread *)&q_timer;
- q_exit.next = q_exit.prev = (struct chx_thread *)&q_exit;
q_join.next = q_join.prev = (struct chx_thread *)&q_join;
tp->next = tp->prev = tp;
tp->mutex_list = NULL;
@@ -724,13 +720,10 @@ chx_exit (void *retval)
if (running->flag_sched_rr)
chx_timer_dequeue (running);
- chx_spin_lock (&q_exit.lock);
- ll_insert (running, &q_exit);
if (running->flag_detached)
running->state = THREAD_FINISHED;
else
running->state = THREAD_EXITED;
- chx_spin_unlock (&q_exit.lock);
asm volatile ("" : : "r" (r8) : "memory");
chx_sched (CHX_SLEEP);
/* never comes here. */
@@ -1165,8 +1158,11 @@ chx_release_irq_thread (struct chx_thread *tp)
chx_spin_lock (&intr_lock);
intr_prev = intr_top;
for (intr = intr_top; intr; intr = intr->next)
- if (intr->tp == tp)
- break;
+ {
+ if (intr->tp == tp)
+ break;
+ intr_prev = intr;
+ }
if (intr)
{