void initSnapShotLibrary(unsigned int numbackingpages,
unsigned int numsnapshots, unsigned int nummemoryregions,
unsigned int numheappages, VoidFuncPtr entryPoint);
-void finalize();
struct stackEntry {
struct stackEntry *next;
sTheRecord->mStackSize = STACK_SIZE_DEFAULT;
sTheRecord->mIDToRollback = -1;
sTheRecord->currSnapShotID = 0;
- sTheRecord->mbFinalize = false;
#endif
}
pid_t forkedID = 0;
snapshotid = sTheRecord->currSnapShotID;
bool swapContext = false;
- while( !sTheRecord->mbFinalize ){
+ while( true ){
sTheRecord->currSnapShotID=snapshotid+1;
forkedID = fork();
if( 0 == forkedID ){
SSDEBUG("Invoked rollback");
exit(EXIT_SUCCESS);
}
+ sTheRecord->mIDToRollback = -1;
#endif
}
-/** The finalize method shuts down the snapshotting system. */
-//Subramanian -- remove this function from the external interface and
-//have us call it internally
-void finalize(){
-#if !USE_MPROTECT_SNAPSHOT
- sTheRecord->mbFinalize = true;
-#endif
-}
/* If USE_MPROTECT_SNAPSHOT=1, then snapshot by using mmap() and mprotect()
If USE_MPROTECT_SNAPSHOT=0, then snapshot by using fork() */
-#define USE_MPROTECT_SNAPSHOT 1
+#define USE_MPROTECT_SNAPSHOT 0
/* Size of signal stack */
#define SIGSTACKSIZE 32768
snapshot_id mIDToRollback;
ucontext_t mContextToRollback;
snapshot_id currSnapShotID;
- volatile bool mbFinalize;
};
extern struct Snapshot * sTheRecord;
#endif