summaryrefslogtreecommitdiff
path: root/nuttx/sched/pthread_detach.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-30 00:49:11 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-30 00:49:11 +0000
commit0bd4fc137b7ba0218159b8ded673efcb9c404ce1 (patch)
treebf608c3bbf2137c325b89b1f9bc66f493e9d3daa /nuttx/sched/pthread_detach.c
parent11020b0eec6061214b2c2e8f7b0d7597faadefde (diff)
downloadpx4-nuttx-0bd4fc137b7ba0218159b8ded673efcb9c404ce1.tar.gz
px4-nuttx-0bd4fc137b7ba0218159b8ded673efcb9c404ce1.tar.bz2
px4-nuttx-0bd4fc137b7ba0218159b8ded673efcb9c404ce1.zip
Correct a race condition in the pthread join logic. Sometimes the join structure was being deallocated while it was still needed.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@180 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/pthread_detach.c')
-rw-r--r--nuttx/sched/pthread_detach.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/nuttx/sched/pthread_detach.c b/nuttx/sched/pthread_detach.c
index ca3f732f4..a1a60acf5 100644
--- a/nuttx/sched/pthread_detach.c
+++ b/nuttx/sched/pthread_detach.c
@@ -109,9 +109,7 @@ int pthread_detach(pthread_t thread)
{
/* YES.. just remove the thread entry. */
- (void)pthread_removejoininfo((pid_t)thread);
- sched_free(pjoin);
- pjoin = NULL;
+ pthread_destroyjoin(pjoin);
}
else
{