diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2017-02-02 16:06:25 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2017-02-02 23:51:55 -0500 |
commit | 4d4b0c5a07c907efda20771fa6baca6f1c91802e (patch) | |
tree | 2cd423f2ec337e3828e3af3de5157c3c500ceb2d /firmware/kernel/thread-internal.h | |
parent | 1fa7c5635184e3a8c16b696a658c027fcc0862d8 (diff) | |
download | rockbox-4d4b0c5a07c907efda20771fa6baca6f1c91802e.tar.gz rockbox-4d4b0c5a07c907efda20771fa6baca6f1c91802e.zip |
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
Diffstat (limited to 'firmware/kernel/thread-internal.h')
-rw-r--r-- | firmware/kernel/thread-internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
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) | |||
419 | corelock_init(&blsplay->cl); | 419 | corelock_init(&blsplay->cl); |
420 | } | 420 | } |
421 | 421 | ||
422 | static inline long get_tmo_tick(struct thread_entry *thread) | ||
423 | { | ||
424 | return thread->tmo_tick; | ||
425 | } | ||
426 | |||
422 | #endif /* THREAD_INTERNAL_H */ | 427 | #endif /* THREAD_INTERNAL_H */ |