Back to index

glibc  2.9
Functions
cleanup.c File Reference
#include <stdlib.h>
#include "pthreadP.h"

Go to the source code of this file.

Functions

void __cleanup_fct_attribute __pthread_register_cancel (__pthread_unwind_buf_t *buf)
 hidden_def (__pthread_register_cancel)

Function Documentation

Definition at line 26 of file cleanup.c.

{
  struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
  struct pthread *self = THREAD_SELF;

  /* Store old info.  */
  ibuf->priv.data.prev = THREAD_GETMEM (self, cleanup_jmp_buf);
  ibuf->priv.data.cleanup = THREAD_GETMEM (self, cleanup);

  /* Store the new cleanup handler info.  */
  THREAD_SETMEM (self, cleanup_jmp_buf, (struct pthread_unwind_buf *) buf);
}

Definition at line 38 of file cleanup.c.

{
  struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;

  THREAD_SETMEM (THREAD_SELF, cleanup_jmp_buf, ibuf->priv.data.prev);
}