summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2014-08-20 05:58:59 -0400
committerMichael Sevakis <jethead71@rockbox.org>2014-08-20 05:58:59 -0400
commit5fb370267f81a8429a76f0237767804b849d1f81 (patch)
tree413f79df97f76560799ad35ccb5eee792f5003cc
parent9fed5fd9e944ce255f4df0ac2ada233ae5f58ec2 (diff)
downloadrockbox-5fb3702.tar.gz
rockbox-5fb3702.tar.bz2
rockbox-5fb3702.zip
Make sure load_context is the last thing in switch_thread.
This should fix the android crash issue (fingers crossed). Change-Id: I9d3f773dbdf7dde60bd76962dcf66a3bad8b0925
-rw-r--r--firmware/kernel/thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/kernel/thread.c b/firmware/kernel/thread.c
index bbd610122b..01395a9d6d 100644
--- a/firmware/kernel/thread.c
+++ b/firmware/kernel/thread.c
@@ -254,18 +254,18 @@ static NO_INLINE void thread_stkov(struct thread_entry *thread)
static FORCE_INLINE void thread_store_context(struct thread_entry *thread)
{
+ store_context(&thread->context);
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
thread->__errno = errno;
#endif
- store_context(&thread->context);
}
static FORCE_INLINE void thread_load_context(struct thread_entry *thread)
{
- load_context(&thread->context);
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
errno = thread->__errno;
#endif
+ load_context(&thread->context);
}
static FORCE_INLINE unsigned int
@@ -1101,12 +1101,12 @@ void switch_thread(void)
RTR_UNLOCK(corep);
enable_irq();
- /* And finally, give control to the next thread. */
- thread_load_context(thread);
-
#ifdef RB_PROFILE
profile_thread_started(THREAD_ID_SLOT(thread->id));
#endif
+
+ /* And finally, give control to the next thread. */
+ thread_load_context(thread);
}
/*---------------------------------------------------------------------------