summaryrefslogtreecommitdiff
path: root/cleanup.c
diff options
context:
space:
mode:
Diffstat (limited to 'cleanup.c')
-rw-r--r--cleanup.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/cleanup.c b/cleanup.c
index 883c8ca..e154266 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -102,7 +102,11 @@ _pthread_pop_cleanup (int execute)
}
+#if !defined(_WIN32) && !defined(_cplusplus)
+
pthread_setspecific (_pthread_cleanupKey, cleanup->prev);
+
+#endif
}
return (cleanup);
@@ -156,8 +160,13 @@ _pthread_push_cleanup (_pthread_cleanup_t * cleanup,
{
cleanup->routine = routine;
cleanup->arg = arg;
+
+#if !defined(_WIN32) && !defined(_cplusplus)
+
cleanup->prev = pthread_getspecific (_pthread_cleanupKey);
+#endif
+
pthread_setspecific (_pthread_cleanupKey, (void *) cleanup);
} /* _pthread_push_cleanup */