예제 #1
0
파일: timing.c 프로젝트: jvernet/apple2
void timing_reinitializeAudio(void) {
    SPINLOCK_ACQUIRE(&_pause_spinLock);
    assert(pthread_self() != cpu_thread_id);
    assert(cpu_isPaused());
    emul_reinitialize_audio = true;
    emul_pause_audio = false;
    emul_resume_audio = false;
    SPINLOCK_RELINQUISH(&_pause_spinLock);
}
예제 #2
0
파일: timing.c 프로젝트: mauiaaron/apple2
static void timing_reinitializeAudio(void) {
    SPINLOCK_ACQUIRE(&_pause_spinLock);
    ASSERT_NOT_ON_CPU_THREAD();
#if !TESTING
    assert(cpu_isPaused());
#endif
    emul_reinitialize_audio = true;
    emul_pause_audio = false;
    emul_resume_audio = false;
    emul_video_dirty = false;
    SPINLOCK_RELINQUISH(&_pause_spinLock);
}
예제 #3
0
파일: timing.c 프로젝트: mauiaaron/apple2
void cpu_pause(void) {
    ASSERT_NOT_ON_CPU_THREAD();

    SPINLOCK_ACQUIRE(&_pause_spinLock);
    do {
        if (is_paused) {
            break;
        }

        // CPU thread will be paused when it next tries to acquire interface_mutex
        LOG("PAUSING CPU...");
        if (!emul_reinitialize_audio) {
            emul_pause_audio = true;
        }
        pthread_mutex_lock(&interface_mutex);
        is_paused = true;
    } while (0);
    SPINLOCK_RELINQUISH(&_pause_spinLock);
}
예제 #4
0
파일: timing.c 프로젝트: mauiaaron/apple2
void cpu_resume(void) {
    ASSERT_NOT_ON_CPU_THREAD();

    SPINLOCK_ACQUIRE(&_pause_spinLock);
    do {
        if (!is_paused) {
            break;
        }

        // CPU thread will be unblocked to acquire interface_mutex
        if (!emul_reinitialize_audio) {
            emul_resume_audio = true;
            emul_video_dirty = true;
        }
        LOG("RESUMING CPU...");
        is_paused = false;
        pthread_mutex_unlock(&interface_mutex);
    } while (0);
    SPINLOCK_RELINQUISH(&_pause_spinLock);
}
예제 #5
0
파일: timing.c 프로젝트: jvernet/apple2
void cpu_resume(void) {
    assert(pthread_self() != cpu_thread_id);

    SPINLOCK_ACQUIRE(&_pause_spinLock);
    do {
        if (!is_paused) {
            break;
        }

        // CPU thread will be unblocked to acquire interface_mutex
#ifdef AUDIO_ENABLED
        if (!emul_reinitialize_audio) {
            emul_resume_audio = true;
        }
#endif
        LOG("RESUMING CPU...");
        pthread_mutex_unlock(&interface_mutex);
        is_paused = false;
    } while (0);
    SPINLOCK_RELINQUISH(&_pause_spinLock);
}
예제 #6
0
파일: timing.c 프로젝트: jvernet/apple2
void cpu_pause(void) {
    assert(pthread_self() != cpu_thread_id);

    SPINLOCK_ACQUIRE(&_pause_spinLock);
    do {
        if (is_paused) {
            break;
        }

        // CPU thread will be paused when it next tries to acquire interface_mutex
        LOG("PAUSING CPU...");
#ifdef AUDIO_ENABLED
        if (!emul_reinitialize_audio) {
            emul_pause_audio = true;
        }
#endif
        pthread_mutex_lock(&interface_mutex);
        is_paused = true;
    } while (0);
    SPINLOCK_RELINQUISH(&_pause_spinLock);
}