summaryrefslogtreecommitdiff
path: root/pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'pthread.h')
-rw-r--r--pthread.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/pthread.h b/pthread.h
index 974a163..bf9ff7b 100644
--- a/pthread.h
+++ b/pthread.h
@@ -170,6 +170,26 @@ int pthread_key_delete(pthread_key_t key);
}
#endif /* __cplusplus */
+/* The following #defines implement POSIX cleanup handlers.
+ The standard requires that these functions be used as statements and
+ be used pairwise in the same scope. The standard suggests that, in C, they
+ may be implemented as macros starting and ending the same block.
+ */
+#ifdef pthread_cleanup_push
+#undef pthread_cleanup_push
+#endif
+#define pthread_cleanup_push(routine, arg) \
+{ \
+ _pthread_cleanup_push(routine, arg);
+
+#ifdef pthread_cleanup_pop
+#undef pthread_cleanup_pop
+#endif
+#define pthread_cleanup_pop(execute) \
+ _pthread_cleanup_pop(execute);\
+}
+
+
/* Below here goes all internal definitions required by this implementation
of pthreads for Win32.
*/