Revert "libc: Call pthread_exit in user-space by up_pthread_exit"

This reverts commit f4a0b7aedd.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi
2022-01-25 17:22:17 +08:00
committed by Xiang Xiao
parent 6814b1416f
commit c0a0de97ce
89 changed files with 112 additions and 537 deletions
-17
View File
@@ -58,7 +58,6 @@
#include <nuttx/irq.h>
#include <nuttx/cancelpt.h>
#include <nuttx/pthread.h>
#include "sched/sched.h"
#include "semaphore/semaphore.h"
@@ -141,15 +140,7 @@ bool enter_cancellation_point(void)
if ((tcb->flags & TCB_FLAG_TTYPE_MASK) ==
TCB_FLAG_TTYPE_PTHREAD)
{
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
tcb->flags &= ~TCB_FLAG_CANCEL_PENDING;
tcb->flags |= TCB_FLAG_CANCEL_DOING;
up_pthread_exit(((FAR struct pthread_tcb_s *)tcb)->exit,
PTHREAD_CANCELED);
#else
pthread_exit(PTHREAD_CANCELED);
#endif
}
else
#endif
@@ -236,15 +227,7 @@ void leave_cancellation_point(void)
if ((tcb->flags & TCB_FLAG_TTYPE_MASK) ==
TCB_FLAG_TTYPE_PTHREAD)
{
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
tcb->flags &= ~TCB_FLAG_CANCEL_PENDING;
tcb->flags |= TCB_FLAG_CANCEL_DOING;
up_pthread_exit(((FAR struct pthread_tcb_s *)tcb)->exit,
PTHREAD_CANCELED);
#else
pthread_exit(PTHREAD_CANCELED);
#endif
}
else
#endif
-8
View File
@@ -112,15 +112,7 @@ int task_setcancelstate(int state, FAR int *oldstate)
if ((tcb->flags & TCB_FLAG_TTYPE_MASK) ==
TCB_FLAG_TTYPE_PTHREAD)
{
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
tcb->flags &= ~TCB_FLAG_CANCEL_PENDING;
tcb->flags |= TCB_FLAG_CANCEL_DOING;
up_pthread_exit(((FAR struct pthread_tcb_s *)tcb)->exit,
PTHREAD_CANCELED);
#else
pthread_exit(PTHREAD_CANCELED);
#endif
}
else
#endif
+1 -9
View File
@@ -100,15 +100,7 @@ int task_setcanceltype(int type, FAR int *oldtype)
#ifndef CONFIG_DISABLE_PTHREAD
if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD)
{
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
tcb->flags &= ~TCB_FLAG_CANCEL_PENDING;
tcb->flags |= TCB_FLAG_CANCEL_DOING;
up_pthread_exit(((FAR struct pthread_tcb_s *)tcb)->exit,
PTHREAD_CANCELED);
#else
pthread_exit(PTHREAD_CANCELED);
#endif
pthread_exit(PTHREAD_CANCELED);
}
else
#endif