PTHREAD_CLEANUP_POP(3) BSD Library Functions Manual PTHREAD_CLEANUP_POP(3)NAME
pthread_cleanup_pop -- call the first cleanup routine
SYNOPSIS
#include <pthread.h>
void
pthread_cleanup_pop(int execute);
DESCRIPTION
The pthread_cleanup_pop() function pops the top cleanup routine off of the current threads cleanup routine stack, and, if execute is non-
zero, it will execute the function. If there is no cleanup routine then pthread_cleanup_pop() does nothing.
The pthread_cleanup_pop() function is implemented as a macro that closes a block. Invocations of this function must appear as standalone
statements that are paired with an earlier call of pthread_cleanup_push(3) in the same lexical scope.
RETURN VALUES
The pthread_cleanup_pop() function does not return any value.
ERRORS
None
SEE ALSO pthread_cleanup_push(3), pthread_exit(3)STANDARDS
The pthread_cleanup_pop() function conforms to ISO/IEC 9945-1:1996 (``POSIX.1'').
BSD October 25, 2014 BSD
Check Out this Related Man Page
PTHREAD_CLEANUP_PUSH(3) BSD Library Functions Manual PTHREAD_CLEANUP_PUSH(3)NAME
pthread_cleanup_push -- add a cleanup function for thread exit
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
void
pthread_cleanup_push(void (*cleanup_routine)(void *), void *arg);
DESCRIPTION
The pthread_cleanup_push() function adds cleanup_routine to the top of the stack of cleanup handlers that get called when the current thread
exits.
When cleanup_routine is called, it is passed arg as its only argument.
The pthread_cleanup_push() 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 pthread_cleanup_pop(3) in the same lexical scope.
RETURN VALUES
The pthread_cleanup_push() function does not return any value.
ERRORS
None
SEE ALSO pthread_cleanup_pop(3), pthread_exit(3)STANDARDS
The pthread_cleanup_push() function conforms to ISO/IEC 9945-1:1996 (``POSIX.1'').
BSD October 25, 2014 BSD
Hello!
First of all, forgive me for bad English.
When I starts new thread (pthread_create), system allocates some memory for it (for example, for thread's stack). I wonder when does it deallocate this memory? The problem is that I have a program which sometimes creates new threads and sometimes... (3 Replies)
hello,
in my free time i am writing on a c++ mud codebase, a while ago i decided that i would move to pthreads, so i could make use of smp. now i have a problem which i just cant fix - for weeks now. i have a main thread which spawns my threads, as soon as spawned they get a pthread_cond_wait, so... (4 Replies)
Hi,
I am working on a project which uses 64-bit capability of AIX. This is
very recently ported to 64-bit and leaking like anything now. I purified
the program on 64-bit and ran it, purify is not showing any leak.
Even memory usage has become very normal in purified binary compared to my... (2 Replies)
Hi,
I am currently working with threads using linux 2.6.11 and glibc 2.3.5 on x86. When i am trying to create thread with user defined stacks glibc gives segmentation fault. I have written a wrapper to pthread_create () and generated shared object for the same. When i am trying to create any... (6 Replies)
Hi all,
I have a scenario where I need to use the mutex locks. The mutex locks are working fine, but sometimes I am getting into the dead lock situation.
Below is the summary of my code :
MUTEX LOCK
performTask();
MUTEX UNLOCK.
In some cases I get into the situation where... (2 Replies)