unified: clean-up timeout code for unpending a thread
Integrate _timeout_remove_tcs_from_wait_q() into _unpend_thread_timing_out(). Change-Id: Id57d9fd8f9e877e580460091172aaabf451f3d4b Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
688973e5ab
commit
601b354ffe
2 changed files with 7 additions and 10 deletions
|
@ -91,15 +91,17 @@ static inline void _nano_timeout_tcs_init(struct tcs *tcs)
|
||||||
*
|
*
|
||||||
* @return N/A
|
* @return N/A
|
||||||
*/
|
*/
|
||||||
static inline void _timeout_object_dequeue(struct tcs *tcs, struct _timeout *t)
|
static inline void _unpend_thread_timing_out(struct k_thread *thread,
|
||||||
|
struct _timeout *timeout_obj)
|
||||||
{
|
{
|
||||||
if (t->wait_q) {
|
if (timeout_obj->wait_q) {
|
||||||
_timeout_remove_tcs_from_wait_q(tcs);
|
_unpend_thread(thread);
|
||||||
|
thread->timeout.wait_q = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define _timeout_object_dequeue(tcs, t) do { } while (0)
|
#define _unpend_thread_timing_out(tcs, timeout_obj) do { } while (0)
|
||||||
#endif /* CONFIG_NANO_TIMEOUTS */
|
#endif /* CONFIG_NANO_TIMEOUTS */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -118,7 +120,7 @@ static inline struct _timeout *_timeout_handle_one_timeout(
|
||||||
|
|
||||||
K_DEBUG("timeout %p\n", t);
|
K_DEBUG("timeout %p\n", t);
|
||||||
if (tcs != NULL) {
|
if (tcs != NULL) {
|
||||||
_timeout_object_dequeue(tcs, t);
|
_unpend_thread_timing_out(tcs, t);
|
||||||
_ready_thread(tcs);
|
_ready_thread(tcs);
|
||||||
} else if (t->func) {
|
} else if (t->func) {
|
||||||
t->func(t);
|
t->func(t);
|
||||||
|
|
|
@ -31,11 +31,6 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_NANO_TIMEOUTS)
|
#if defined(CONFIG_NANO_TIMEOUTS)
|
||||||
static inline void _timeout_remove_tcs_from_wait_q(struct tcs *tcs)
|
|
||||||
{
|
|
||||||
_unpend_thread(tcs);
|
|
||||||
tcs->timeout.wait_q = NULL;
|
|
||||||
}
|
|
||||||
#include <timeout_q.h>
|
#include <timeout_q.h>
|
||||||
|
|
||||||
#elif defined(CONFIG_NANO_TIMERS)
|
#elif defined(CONFIG_NANO_TIMERS)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue