Back to index

avfs  1.0.1
Classes | Functions | Variables
exit.c File Reference
#include "exit.h"
#include "avfs.h"

Go to the source code of this file.

Classes

struct  exithandler

Functions

static AV_LOCK_DECL (exit_lock)
void av_do_exit ()
void av_add_exithandler (void(*func)())

Variables

static struct exithandlerexit_handlers = NULL

Function Documentation

void av_add_exithandler ( void(*)()  func)

Definition at line 33 of file exit.c.

{
    struct exithandler *hand;
    
    AV_NEW(hand);
    hand->func = func;
    AV_LOCK(exit_lock);
    hand->next = exit_handlers;
    exit_handlers = hand;
    AV_UNLOCK(exit_lock);
}

Here is the caller graph for this function:

void av_do_exit ( )

Definition at line 20 of file exit.c.

{
    struct exithandler *hand;

    AV_LOCK(exit_lock);
    for(hand = exit_handlers; hand != NULL; hand = exit_handlers) {
        exit_handlers = hand->next;
        hand->func();
        av_free(hand);
    }
    AV_UNLOCK(exit_lock);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static AV_LOCK_DECL ( exit_lock  ) [static]

Variable Documentation

struct exithandler* exit_handlers = NULL [static]

Definition at line 18 of file exit.c.