mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
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:
+10
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user