Fix bad conditional logic in mkconfig.c; Add user-mode pthread start-up logic

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5748 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-03-16 17:37:40 +00:00
parent 3daa175977
commit 76d1ad21f2
20 changed files with 392 additions and 34 deletions
+10 -2
View File
@@ -185,11 +185,19 @@ static void pthread_start(void)
pjoin->started = true;
(void)pthread_givesemaphore(&pjoin->data_sem);
/* Pass control to the thread entry point. */
/* Pass control to the thread entry point. In the kernel build this has to
* be handled differently if we are starting a user-space pthread; we have
* to switch to user-mode before calling into the pthread.
*/
#ifdef CONFIG_NUTTX_KERNEL
up_pthread_start(ptcb->cmn.entry.pthread, ptcb->arg);
exit_status = NULL;
#else
exit_status = (*ptcb->cmn.entry.pthread)(ptcb->arg);
#endif
/* The thread has returned */
/* The thread has returned (should never happen in the kernel mode case) */
pthread_exit(exit_status);
}