2 * Copyright 2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
7 #include "pthread_private.h"
11 __pthread_cleanup_push_handler(__pthread_cleanup_handler
* handler
)
13 pthread_thread
* thread
= pthread_self();
17 handler
->previous
= thread
->cleanup_handlers
;
18 thread
->cleanup_handlers
= handler
;
22 __pthread_cleanup_handler
*
23 __pthread_cleanup_pop_handler(void)
25 pthread_thread
* thread
= pthread_self();
29 __pthread_cleanup_handler
* handler
= thread
->cleanup_handlers
;
33 thread
->cleanup_handlers
= handler
->previous
;