Make sure load_context is the last thing in switch_thread.

This should fix the android crash issue (fingers crossed).

Change-Id: I9d3f773dbdf7dde60bd76962dcf66a3bad8b0925
This commit is contained in:
Michael Sevakis 2014-08-20 05:58:59 -04:00
parent 9fed5fd9e9
commit 5fb370267f

View file

@ -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);
}
/*---------------------------------------------------------------------------