summaryrefslogtreecommitdiff
path: root/nptl/pthread_tryjoin.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_tryjoin.c')
-rw-r--r--nptl/pthread_tryjoin.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/nptl/pthread_tryjoin.c b/nptl/pthread_tryjoin.c
index 7b3ad2bc74..0383ffd224 100644
--- a/nptl/pthread_tryjoin.c
+++ b/nptl/pthread_tryjoin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <atomic.h>
-#include "pthreadP.h"
+#include <pthreadP.h>
int
@@ -29,10 +29,18 @@ pthread_tryjoin_np (threadid, thread_return)
void **thread_return;
{
struct pthread *self;
+#ifndef PTHREAD_T_IS_TID
struct pthread *pd = (struct pthread *) threadid;
+#else
+ struct pthread *pd = __find_in_stack_list (threadid);
+#endif
/* Make sure the descriptor is valid. */
+#ifndef PTHREAD_T_IS_TID
if (DEBUGGING_P && __find_in_stack_list (pd) == NULL)
+#else
+ if ((pd) == NULL)
+#endif
/* Not a valid thread handle. */
return ESRCH;
@@ -53,7 +61,11 @@ pthread_tryjoin_np (threadid, thread_return)
return EDEADLK;
/* Return right away if the thread hasn't terminated yet. */
+#ifndef lll_tryjoin
if (pd->tid != 0)
+#else
+ if (lll_tryjoin (pd->tid) != 0)
+#endif
return EBUSY;
/* Wait for the thread to finish. If it is already locked something