diff options
| author | David Xu <davidxu@FreeBSD.org> | 2008-06-09 01:14:10 +0000 |
|---|---|---|
| committer | David Xu <davidxu@FreeBSD.org> | 2008-06-09 01:14:10 +0000 |
| commit | 83a07587898c460f4444b85725f2dbdf26cf6f33 (patch) | |
| tree | 64448ccd5c1431710c5a1f4513a5128d2db5c444 /include/pthread.h | |
| parent | e14e342b1469067ef543e6bd4f0abbd835f67e2c (diff) | |
Notes
Diffstat (limited to 'include/pthread.h')
| -rw-r--r-- | include/pthread.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/pthread.h b/include/pthread.h index 215b88258fec..fad12b1be218 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -135,6 +135,10 @@ enum pthread_mutextype { #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_ERRORCHECK +struct _pthread_cleanup_info { + __uintptr_t pthread_cleanup_pad[8]; +}; + /* * Thread function prototype definitions: */ @@ -162,8 +166,19 @@ int pthread_barrierattr_getpshared(const pthread_barrierattr_t *, int *); int pthread_barrierattr_init(pthread_barrierattr_t *); int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int); -void pthread_cleanup_pop(int); -void pthread_cleanup_push(void (*) (void *), void *); + +#define pthread_cleanup_push(cleanup_routine, cleanup_arg) \ + { \ + struct _pthread_cleanup_info __cleanup_info__; \ + __pthread_cleanup_push_imp(cleanup_routine, cleanup_arg,\ + &__cleanup_info__); \ + { + +#define pthread_cleanup_pop(execute) \ + } \ + __pthread_cleanup_pop_imp(execute); \ + } + int pthread_condattr_destroy(pthread_condattr_t *); int pthread_condattr_getclock(const pthread_condattr_t *, clockid_t *); @@ -268,6 +283,10 @@ int pthread_setschedparam(pthread_t, int, const struct sched_param *); int pthread_getconcurrency(void); int pthread_setconcurrency(int); + +void __pthread_cleanup_push_imp(void (*)(void *), void *, + struct _pthread_cleanup_info *); +void __pthread_cleanup_pop_imp(int); __END_DECLS #endif |
