summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/cancel.c
diff options
context:
space:
mode:
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