Back to index

glibc  2.9
Functions
jmp-unwind.c File Reference
#include <setjmp.h>
#include <stddef.h>
#include <pthreadP.h>

Go to the source code of this file.

Functions

void __pthread_cleanup_upto (__jmp_buf env, char *targetframe)
void _longjmp_unwind (jmp_buf env, int val)

Function Documentation

void __pthread_cleanup_upto ( __jmp_buf  env,
char *  targetframe 
)

Definition at line 33 of file ptcleanup.c.

{
  pthread_descr self = thread_self();
  struct _pthread_cleanup_buffer * c;

  for (c = THREAD_GETMEM(self, p_cleanup);
       c != NULL && _JMPBUF_UNWINDS(target, c, demangle_ptr);
       c = c->__prev)
    {
#if _STACK_GROWS_DOWN
      if ((char *) c <= targetframe)
       {
         c = NULL;
         break;
       }
#elif _STACK_GROWS_UP
      if ((char *) c >= targetframe)
       {
         c = NULL;
         break;
       }
#else
# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
#endif
      c->__routine(c->__arg);
    }
  THREAD_SETMEM(self, p_cleanup, c);
  if (THREAD_GETMEM(self, p_in_sighandler)
      && _JMPBUF_UNWINDS(target, THREAD_GETMEM(self, p_in_sighandler),
                      demangle_ptr))
    THREAD_SETMEM(self, p_in_sighandler, NULL);
}

Here is the call graph for this function:

void _longjmp_unwind ( jmp_buf  env,
int  val 
)

Definition at line 29 of file jmp-unwind.c.

{
  unsigned char local_var;

#ifdef SHARED
  if (__libc_pthread_functions_init)
    PTHFCT_CALL (ptr___pthread_cleanup_upto, (env->__jmpbuf, &local_var));
#else
  if (__pthread_cleanup_upto != NULL)
    __pthread_cleanup_upto (env->__jmpbuf, &local_var);
#endif
}

Here is the call graph for this function: