linux-lts-quantal-3.5.0/kernel/replay.c
// PARSPEC: will have replay threads exiting when each epoch is over
will have replay threads exiting when each epoch is over
will have replay threads exiting when each epoch is over
void
recplay_exit_finish(void)
{
	if (current->record_thrd) {
		struct record_group* prg = current->record_thrd->rp_group;
		MPRINT ("Record thread %d has exited\n", current->pid);
		get_record_group(prg);
		rg_lock(prg);
		__destroy_record_thread (current->record_thrd);
		current->record_thrd = NULL;
		MPRINT ("Record Pid-%d, tsk %p, exiting!\n", current->pid, current);
		rg_unlock(prg);
		put_record_group(prg);
	} else if (current->replay_thrd) {
		struct replay_thread* prt = current->replay_thrd;
		struct replay_group* prg = prt->rp_group;
		struct record_group* precg = prg->rg_rec_group;
#ifdef REPLAY_PARANOID
		BUG_ON (!prg);
		BUG_ON (!precg);
#endif
		get_record_group(precg);
		rg_lock(precg);
		MPRINT ("Replay Pid %d about to exit\n", current->pid);
		put_replay_group (prg);
		current->replay_thrd = NULL;
		rg_unlock(precg);
		put_record_group(precg);
	}
}
void recplay_exit_finish ( void ) { if ( current -> record_thrd ) { struct record_group * prg = current -> record_thrd -> rp_group ; MPRINT ( " \n " , current -> pid ) ; get_record_group ( prg ) ; rg_lock ( prg ) ; __destroy_record_thread ( current -> record_thrd ) ; current -> record_thrd = NULL ; MPRINT ( " \n " , current -> pid , current ) ; rg_unlock ( prg ) ; put_record_group ( prg ) ; } else if ( current -> replay_thrd ) { struct replay_thread * prt = current -> replay_thrd ; struct replay_group * prg = prt -> rp_group ; struct record_group * precg = prg -> rg_rec_group ; #ifdef REPLAY_PARANOID BUG_ON ( ! prg ) ; BUG_ON ( ! precg ) ; #endif get_record_group ( precg ) ; rg_lock ( precg ) ; MPRINT ( " \n " , current -> pid ) ; put_replay_group ( prg ) ; current -> replay_thrd = NULL ; rg_unlock ( precg ) ; put_record_group ( precg ) ; } }
PARSPEC: will have replay threads exiting when each epoch is over
PARSPEC : will have replay threads exiting when each epoch is over
/* Hold a reference to prg through __destroy_record_thread()
		 * so it can be unlocked before it is freed. */ /* Hold a reference to precg so it can be unlocked before it is freed. */