kernel: have _nano_timeout_abort() return an error code
An upcoming fix for _fiber_wakeup() will need to know if the fiber was dequeued from a timeout queue. Change-Id: I09ca039098c09a997db73f4719261352f0af07c1 Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
bf77d902ac
commit
b1903d7e48
1 changed files with 4 additions and 2 deletions
|
@ -85,13 +85,13 @@ static inline void _nano_timeout_handle_timeouts(void)
|
|||
}
|
||||
|
||||
/* abort a timeout for a specific fiber */
|
||||
static inline void _nano_timeout_abort(struct tcs *tcs)
|
||||
static inline int _nano_timeout_abort(struct tcs *tcs)
|
||||
{
|
||||
sys_dlist_t *timeout_q = &_nanokernel.timeout_q;
|
||||
struct _nano_timeout *t = &tcs->nano_timeout;
|
||||
|
||||
if (-1 == t->delta_ticks_from_prev) {
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!sys_dlist_is_tail(timeout_q, &t->node)) {
|
||||
|
@ -102,6 +102,8 @@ static inline void _nano_timeout_abort(struct tcs *tcs)
|
|||
}
|
||||
sys_dlist_remove(&t->node);
|
||||
t->delta_ticks_from_prev = -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue