diff --git a/sched/pthread/pthread_completejoin.c b/sched/pthread/pthread_completejoin.c index dedabf19a3..42656c1705 100644 --- a/sched/pthread/pthread_completejoin.c +++ b/sched/pthread/pthread_completejoin.c @@ -203,7 +203,10 @@ int pthread_completejoin(pid_t pid, FAR void *exit_value) if (ret != OK) { nxmutex_unlock(&group->tg_joinlock); - return tcb->flags & TCB_FLAG_DETACHED ? OK : ERROR; + + return ((tcb->flags & TCB_FLAG_DETACHED) || + (tcb->flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_PTHREAD) ? + OK : ERROR; } else { diff --git a/sched/pthread/pthread_exit.c b/sched/pthread/pthread_exit.c index 5280bf5f92..946e0eac8a 100644 --- a/sched/pthread/pthread_exit.c +++ b/sched/pthread/pthread_exit.c @@ -69,7 +69,6 @@ void nx_pthread_exit(FAR void *exit_value) sinfo("exit_value=%p\n", exit_value); DEBUGASSERT(tcb != NULL); - DEBUGASSERT((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD); /* Block any signal actions that would awaken us while were * are performing the JOIN handshake.