Fix timer expiration.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2017-12-16 NIIBE Yutaka <gniibe@fsij.org>
|
||||
|
||||
* chopstx.c (chx_timer_expired): Bug fix of wake up.
|
||||
(chx_mutex_unlock): Avoid non-deterministic thing.
|
||||
|
||||
2017-12-14 NIIBE Yutaka <gniibe@fsij.org>
|
||||
|
||||
* board/board-st-nucleo-f103.h: Update.
|
||||
|
||||
@@ -287,7 +287,7 @@ chx_request_preemption (uint16_t prio)
|
||||
*
|
||||
* Returns:
|
||||
* 1 on wakeup by others.
|
||||
* 0 on normal wakeup.
|
||||
* 0 on normal wakeup (timer expiration, getting lock).
|
||||
* -1 on cancellation.
|
||||
*/
|
||||
static uintptr_t __attribute__ ((naked, noinline))
|
||||
|
||||
@@ -403,6 +403,7 @@ chx_timer_expired (void)
|
||||
tp = tp_next)
|
||||
{
|
||||
next_tick = tp->v;
|
||||
tp->v = (uintptr_t)0;
|
||||
tp_next = (struct chx_thread *)tp->next;
|
||||
ll_dequeue ((struct chx_pq *)tp);
|
||||
chx_ready_enqueue (tp);
|
||||
@@ -575,6 +576,7 @@ chx_mutex_unlock (chopstx_mutex_t *mutex)
|
||||
uint16_t newprio = running->prio_orig;
|
||||
chopstx_mutex_t *m;
|
||||
|
||||
tp->v = (uintptr_t)0;
|
||||
chx_ready_enqueue (tp);
|
||||
|
||||
/* Examine mutexes we hold, and determine new priority for running. */
|
||||
|
||||
Reference in New Issue
Block a user