more fixes for chopstx_poll

This commit is contained in:
NIIBE Yutaka
2016-05-13 14:52:38 +09:00
parent daa7aebd6f
commit db6e668524
2 changed files with 8 additions and 7 deletions

View File

@@ -1,6 +1,8 @@
2016-05-13 NIIBE Yutaka <gniibe@fsij.org>
* chopstx.c (chx_sched) [__ARM_ARCH_6M__]: Fix asm.
(chx_handle_intr, chx_wakeup, chopstx_cancel): Fix for polling
with no timeout.
* example-cdc/sample.c (main): Update chopstx_poll example.
* example-fs-bb48/sample.c (main): Ditto.

View File

@@ -245,10 +245,6 @@ static struct chx_queue q_join;
/* Forward declaration(s). */
static void chx_request_preemption (uint16_t prio);
static void chx_timer_dequeue (struct chx_thread *tp);
static struct chx_thread *chx_timer_insert (struct chx_thread *tp,
uint32_t usec);
/**************/
@@ -641,6 +637,7 @@ chx_handle_intr (void)
{
if (intr->tp->state == THREAD_WAIT_POLL)
{
if (intr->tp->parent == &q_timer.q)
chx_timer_dequeue (intr->tp);
chx_ready_enqueue (intr->tp);
chx_request_preemption (intr->tp->prio);
@@ -938,6 +935,7 @@ chx_wakeup (struct chx_thread *tp)
tp = px->master;
if (tp->state == THREAD_WAIT_POLL)
{
if (tp->parent == &q_timer.q)
chx_timer_dequeue (tp);
((struct chx_stack_regs *)tp->tc.reg[REG_SP])->reg[REG_R0] = -1;
chx_ready_enqueue (tp);
@@ -1761,7 +1759,8 @@ chopstx_cancel (chopstx_t thd)
ll_dequeue ((struct chx_pq *)tp);
chx_spin_unlock (&cond->lock);
}
else if (tp->state == THREAD_WAIT_TIME || tp->state == THREAD_WAIT_POLL)
else if ((tp->state == THREAD_WAIT_TIME || tp->state == THREAD_WAIT_POLL)
&& (tp->parent == &q_timer.q))
chx_timer_dequeue (tp);
chx_ready_enqueue (tp);