Add support for pthread_cleanup() routines
authorKevin Klues <klueska@cs.berkeley.edu>
Fri, 4 Sep 2015 01:21:50 +0000 (18:21 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 6 Oct 2015 20:31:50 +0000 (16:31 -0400)
commit41aafa9527d18b366104e9b6dfa3c5479d2253df
tree6e94068d50048d3c4417cd9fa5dbcc646ee49c4f
parent538b77b7fb4a95eee8170c9ae4ef868c42f686ef
Add support for pthread_cleanup() routines

We still don't support pthread_cancel(), but at least now any cleanup
routines will be executed properly upon pthread_exit().
Also, we could consider turning these into macros and removing the
malloc/free calls because these functions are guaranteed by the POSIX
standard to be called in the same lexical scope:

http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_cleanup_pop.html

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tests/pthread_cleanup_test.c [new file with mode: 0644]
user/pthread/pthread.c
user/pthread/pthread.h