Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sched/pthread/pthread_completejoin.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,21 @@ static void pthread_removejoininfo(FAR struct task_group_s *group,

int pthread_completejoin(pid_t pid, FAR void *exit_value)
{
FAR struct task_group_s *group = task_getgroup(pid);
FAR struct tcb_s *tcb = nxsched_get_tcb(pid);
FAR struct task_group_s *group = tcb ? tcb->group : NULL;
FAR struct join_s *pjoin;

sinfo("pid=%d exit_value=%p group=%p\n", pid, exit_value, group);
DEBUGASSERT(group);
DEBUGASSERT(group && tcb);

/* First, find thread's structure in the private data set. */

nxmutex_lock(&group->tg_joinlock);
pjoin = pthread_findjoininfo(group, pid);
if (!pjoin)
{
serr("ERROR: Could not find join info, pid=%d\n", pid);
nxmutex_unlock(&group->tg_joinlock);
return ERROR;
return tcb->flags & TCB_FLAG_DETACHED ? OK : ERROR;
}
else
{
Expand Down