X-Git-Url: https://git.saurik.com/apple/libpthread.git/blobdiff_plain/3a6437e67ee23e43516c71ee42f674e6cfa9dc75..2546420a235d38941a7eed560a8cb61403ecb8e2:/man/pthread_cleanup_push.3 diff --git a/man/pthread_cleanup_push.3 b/man/pthread_cleanup_push.3 index 91ec386..f092868 100644 --- a/man/pthread_cleanup_push.3 +++ b/man/pthread_cleanup_push.3 @@ -25,47 +25,50 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libc_r/man/pthread_cleanup_push.3,v 1.5.2.4 2001/08/17 15:42:51 ru Exp $ +.\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_PUSH 3 .Os .Sh NAME .Nm pthread_cleanup_push .Nd add a cleanup function for thread exit .Sh SYNOPSIS -.Fd #include +.In pthread.h .Ft void -.Fo pthread_cleanup_push -.Fa "void \*[lp]*routine\*[rp]\*[lp]void *\*[rp]" -.Fa "void *arg" -.Fc +.Fn pthread_cleanup_push "void \*[lp]*cleanup_routine\*[rp]\*[lp]void *\*[rp]" "void *arg" .Sh DESCRIPTION The .Fn pthread_cleanup_push function adds -.Fa routine +.Fa cleanup_routine to the top of the stack of cleanup handlers that get called when the current thread exits. .Pp When -.Fa routine +.Fa cleanup_routine is called, it is passed .Fa arg as its only argument. +.Pp +The .Fn pthread_cleanup_push -must be paired with a corresponding -.Xr pthread_cleanup_pop 3 +function is implemented as a macro that opens a new block. +Invocations of this function must appear as standalone statements that are +paired with a later call of +.Xr pthread_cleanup_pop 3 in the same lexical scope. .Sh RETURN VALUES +The .Fn pthread_cleanup_push -does not return any value. +function does not return any value. .Sh ERRORS None .Sh SEE ALSO .Xr pthread_cleanup_pop 3 , .Xr pthread_exit 3 .Sh STANDARDS +The .Fn pthread_cleanup_push -conforms to +function conforms to .St -p1003.1-96 .