Back to index

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

Go to the source code of this file.

Functions

void _pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer, void(*)(void *) routine, void *arg)
 strong_alias (_pthread_cleanup_push, __pthread_cleanup_push)

Function Documentation

void _pthread_cleanup_push ( struct _pthread_cleanup_buffer buffer,
void (*) (void *)  routine,
void *  arg 
)

Definition at line 25 of file cleanup_compat.c.

{
  struct pthread *self = THREAD_SELF;

  buffer->__routine = routine;
  buffer->__arg = arg;
  buffer->__prev = THREAD_GETMEM (self, cleanup);

  THREAD_SETMEM (self, cleanup, buffer);
}
strong_alias ( _pthread_cleanup_push  ,
__pthread_cleanup_push   
)

Definition at line 38 of file cleanup_compat.c.

{
  struct pthread *self __attribute ((unused)) = THREAD_SELF;

  THREAD_SETMEM (self, cleanup, buffer->__prev);

  /* If necessary call the cleanup routine after we removed the
     current cleanup block from the list.  */
  if (execute)
    buffer->__routine (buffer->__arg);
}