summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/cancel.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-08-06 14:49:17 +0000
committerEric Andersen <andersen@codepoet.org>2002-08-06 14:49:17 +0000
commit7711a9b8e870372e19f6bea41a70baa0ea2878dd (patch)
tree25e6076580afd740b38ebb92b827c8ca0438baa9 /libpthread/linuxthreads/cancel.c
parent0a2d7c0bb713079a668162883e5ccdacf92f4beb (diff)
Several pthreads updates. Enable linuxthreads_db. Several fixes
related to thread local storage. -Erik
Diffstat (limited to 'libpthread/linuxthreads/cancel.c')
-rw-r--r--libpthread/linuxthreads/cancel.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpthread/linuxthreads/cancel.c b/libpthread/linuxthreads/cancel.c
index 8fd8c1e60..42484bb1e 100644
--- a/libpthread/linuxthreads/cancel.c
+++ b/libpthread/linuxthreads/cancel.c
@@ -14,11 +14,18 @@
/* Thread cancellation */
+#define __FORCE_GLIBC
+#include <features.h>
#include <errno.h>
#include "pthread.h"
#include "internals.h"
#include "spinlock.h"
#include "restart.h"
+#ifdef __UCLIBC_HAS_RPC__
+#include <rpc/rpc.h>
+extern void __rpc_thread_destroy(void);
+#endif
+
int pthread_setcancelstate(int state, int * oldstate)
{
@@ -160,6 +167,12 @@ void __pthread_perform_cleanup(void)
struct _pthread_cleanup_buffer * c;
for (c = THREAD_GETMEM(self, p_cleanup); c != NULL; c = c->__prev)
c->__routine(c->__arg);
+
+#ifdef __UCLIBC_HAS_RPC__
+ /* And the TSD which needs special help. */
+ if (THREAD_GETMEM(self, p_libc_specific[_LIBC_TSD_KEY_RPC_VARS]) != NULL)
+ __rpc_thread_destroy ();
+#endif
}
#ifndef PIC