#include "reincarnation_callback.h"
#include "init.h"
#include <list.h>
#include <stdlib.h>
Go to the source code of this file.
Classes | |
struct | reincarnation_callback |
Typedefs | |
typedef reincarnation_callback | reincarnation_callback_t |
Functions | |
LIST_HEAD (theRegisteredCallbacks) | |
void | mnemosyne_reincarnation_callback_register (void(*initializer)()) |
void | mnemosyne_reincarnation_callback_execute_all () |
Definition in file reincarnation_callback.c.
LIST_HEAD | ( | theRegisteredCallbacks | ) |
The list of registered callbacks.
void mnemosyne_reincarnation_callback_execute_all | ( | ) |
Runs all currently-registered callbacks given by clients of the mnemosyne library. These callbacks will execute under the assumption that persistent memory has been mapped for all global objects and that dynamically-allocated persistent segments have been re-mapped.
Definition at line 69 of file reincarnation_callback.c.
References list_head::next, and reincarnation_callback::routine.
void mnemosyne_reincarnation_callback_register | ( | void(*)() | initializer | ) |
Registers an callback function which is run upon reincarnation of a persistent address space. The client library (or application) may, at this time, be assured that any persistent globals are valid, as well as any dynamic segments which are run.
To register a callback successfully, the routine initializing the callback must run in a constructor (the gcc attribute constructor). It does not matter that this constructor run before or after mnemosyne initializes; in one case, the callback will be queued. In the other, it will be run.
Callbacks registered through this method will be executed in order.
initialize | will be called immediately upon complete reincarnation of the persistent address space. |
Definition at line 57 of file reincarnation_callback.c.
References reincarnation_callback::list, and reincarnation_callback::routine.