From 4d4b0c5a07c907efda20771fa6baca6f1c91802e Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 2 Feb 2017 16:06:25 -0500 Subject: In queue_wait_w_tmo, guarantee wait duration It is possible to have a thread awoken and subsequently the message that was placed in the queue has been removed by the time the thread is able to check the queue. Ensure theads that failed to find a message do not return prematurely. It was at worst imprecise when a timeout is specified. It's entirely incorrect if the function ever returns with SYS_TIMEOUT when using TIMEOUT_BLOCK. Change-Id: Ibd41eae8c787adf7a320a24603cf64ff8a6da66a --- firmware/kernel/thread-internal.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'firmware/kernel/thread-internal.h') diff --git a/firmware/kernel/thread-internal.h b/firmware/kernel/thread-internal.h index 868e57c65c..fe053fa070 100644 --- a/firmware/kernel/thread-internal.h +++ b/firmware/kernel/thread-internal.h @@ -419,4 +419,9 @@ static inline void blocker_splay_init(struct blocker_splay *blsplay) corelock_init(&blsplay->cl); } +static inline long get_tmo_tick(struct thread_entry *thread) +{ + return thread->tmo_tick; +} + #endif /* THREAD_INTERNAL_H */ -- cgit v1.2.3