Compare commits

3 Commits

Author SHA1 Message Date
NIIBE Yutaka
a30a069ed8 Version 0.10 2015-09-15 10:39:36 +09:00
NIIBE Yutaka
8fed803085 bug fixes around cancel/join/exit 2015-09-15 10:26:40 +09:00
NIIBE Yutaka
4705e2fb15 fix cancellation 2015-09-11 17:04:28 +09:00
7 changed files with 45 additions and 16 deletions

View File

@@ -1,3 +1,21 @@
2015-09-15 Niibe Yutaka <gniibe@fsij.org>
* VERSION: 0.10.
* doc/chopstx.texi (VERSION): 0.10.
* example-cdc/usb_stm32f103.c: Update from Gnuk.
2015-09-14 Niibe Yutaka <gniibe@fsij.org>
* chopstx.c (q_exit): Remove.
(chx_init, chx_exit): Remove access to Q_EXIT.
(chx_release_irq_thread): Fix removing form the list.
2015-09-11 Niibe Yutaka <gniibe@fsij.org>
* chopstx.c (chx_init, chopstx_create): Fix the initial value
of flag_cancelable.
2015-09-10 Niibe Yutaka <gniibe@fsij.org>
* VERSION: 0.09.

13
NEWS
View File

@@ -1,6 +1,19 @@
NEWS - Noteworthy changes
* Major changes in Chopstx 0.10
Released 2015-09-15
** Thread cancellation bug fix
Thread cancellation didn't work well with 0.09 because
of initial configuration mistake. It's fixed.
** Interrupt handler bug fix
Interrupt handler wasn't unregistered on exit well.
It's fixed.
* Major changes in Chopstx 0.09
Released 2015-09-10

4
README
View File

@@ -1,6 +1,6 @@
Chopstx - Threads and only Threads
Version 0.09
2015-09-10
Version 0.10
2015-09-15
Niibe Yutaka
Flying Stone Technology

View File

@@ -1 +1 @@
release/0.09
release/0.10

View File

@@ -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,13 +628,13 @@ 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;
tp->clp = NULL;
tp->state = THREAD_RUNNING;
tp->flag_got_cancel = tp->flag_join_req = tp->flag_cancelable = 0;
tp->flag_got_cancel = tp->flag_join_req = 0;
tp->flag_cancelable = 1;
tp->flag_sched_rr = (CHX_FLAGS_MAIN & CHOPSTX_SCHED_RR)? 1 : 0;
tp->flag_detached = (CHX_FLAGS_MAIN & CHOPSTX_DETACHED)? 1 : 0;
tp->prio_orig = CHX_PRIO_MAIN_INIT;
@@ -723,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. */
@@ -817,7 +811,8 @@ chopstx_create (uint32_t flags_and_prio,
tp->mutex_list = NULL;
tp->clp = NULL;
tp->state = THREAD_EXITED;
tp->flag_got_cancel = tp->flag_join_req = tp->flag_cancelable = 0;
tp->flag_got_cancel = tp->flag_join_req = 0;
tp->flag_cancelable = 1;
tp->flag_sched_rr = (flags_and_prio & CHOPSTX_SCHED_RR)? 1 : 0;
tp->flag_detached = (flags_and_prio & CHOPSTX_DETACHED)? 1 : 0;
tp->prio_orig = tp->prio = prio;
@@ -1163,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)
{

View File

@@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename chopstx.info
@set VERSION 0.09
@set VERSION 0.10
@settitle Chopstx Reference Manual
@c Unify some of the indices.
@syncodeindex tp fn

View File

@@ -727,7 +727,7 @@ static int std_set_interface (uint8_t req, struct control_info *detail)
if ((req & REQUEST_DIR) == 1 || rcp != INTERFACE_RECIPIENT
|| detail->len != 0 || (detail->index >> 8) != 0
|| (detail->value >> 8) != 0 || dev_p->current_configuration != 0)
|| (detail->value >> 8) != 0 || dev_p->current_configuration == 0)
return USB_UNSUPPORT;
return usb_cb_interface (USB_SET_INTERFACE, detail);