예제 #1
0
파일: traps.c 프로젝트: ApolloniaUK/PUAE
/*
 * Handles completion of an extended trap and passes
 * return value from trap function to 68k space.
 */
static uae_u32 REGPARAM3 exit_trap_handler (TrapContext *dummy_ctx)
{
	TrapContext *context = current_context;

	/* Wait for trap context thread to exit. */
	uae_wait_thread (context->thread);

	/* Restore 68k state saved at trap entry. */
	regs = context->saved_regs;

	/* If trap is supposed to return a value, then store
	 * return value in D0. */
	if (context->trap_has_retval)
		m68k_dreg (regs, 0) = context->trap_retval;

	uae_sem_destroy (&context->switch_to_trap_sem);
	uae_sem_destroy (&context->switch_to_emu_sem);

	xfree (context);

	/* End critical section */
	uae_sem_post (&trap_mutex);

	/* Dummy return value. */
	return 0;
}
예제 #2
0
cda_audio::~cda_audio() {
    write_log("cda_audio::~cda_audio()\n");
    wait(0);
    wait(1);
#if 0
    write_log("waiting for cdda thread\n");
    mStopThread = 1;
    uae_wait_thread(mThread);
    write_log("done waiting for cdda thread\n");
#endif
    for (int i = 0; i < 2; i++) {
        xfree (buffers[i]);
        buffers[i] = NULL;
    }
}