diff --git a/SheepShaver/src/BeOS/main_beos.cpp b/SheepShaver/src/BeOS/main_beos.cpp index 7d654479..967b3c3e 100644 --- a/SheepShaver/src/BeOS/main_beos.cpp +++ b/SheepShaver/src/BeOS/main_beos.cpp @@ -1248,6 +1248,7 @@ status_t SheepShaver::tick_func(void *arg) void TriggerInterrupt(void) { + idle_resume(); #if 0 WriteMacInt32(0x16a, ReadMacInt32(0x16a) + 1); #else diff --git a/SheepShaver/src/Unix/configure.ac b/SheepShaver/src/Unix/configure.ac index 5377a93e..f2ab46fb 100644 --- a/SheepShaver/src/Unix/configure.ac +++ b/SheepShaver/src/Unix/configure.ac @@ -192,6 +192,7 @@ no:linux*|no:netbsd*) ]) ]) AC_CHECK_FUNCS(pthread_cancel) + AC_CHECK_FUNCS(pthread_cond_init) AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) AC_CHECK_FUNCS(pthread_mutexattr_settype) AC_CHECK_FUNCS(pthread_mutexattr_setpshared) diff --git a/SheepShaver/src/Unix/main_unix.cpp b/SheepShaver/src/Unix/main_unix.cpp index b5f03516..41b120f8 100644 --- a/SheepShaver/src/Unix/main_unix.cpp +++ b/SheepShaver/src/Unix/main_unix.cpp @@ -1513,8 +1513,10 @@ void B2_delete_mutex(B2_mutex *mutex) #if !EMULATED_PPC void TriggerInterrupt(void) { - if (ready_for_signals) + if (ready_for_signals) { + idle_resume(); pthread_kill(emul_thread, SIGUSR2); + } } #endif diff --git a/SheepShaver/src/emul_op.cpp b/SheepShaver/src/emul_op.cpp index cfb90bc5..ba5de77f 100644 --- a/SheepShaver/src/emul_op.cpp +++ b/SheepShaver/src/emul_op.cpp @@ -463,14 +463,14 @@ void EmulOp(M68kRegisters *r, uint32 pc, int selector) case OP_IDLE_TIME: // Sleep if no events pending if (ReadMacInt32(0x14c) == 0) - Delay_usec(16667); + idle_wait(); r->a[0] = ReadMacInt32(0x2b6); break; case OP_IDLE_TIME_2: // Sleep if no events pending if (ReadMacInt32(0x14c) == 0) - Delay_usec(16667); + idle_wait(); r->d[0] = (uint32)-2; break; diff --git a/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp b/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp index 0ed289c9..7fdd71ea 100644 --- a/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp +++ b/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp @@ -915,6 +915,7 @@ void emul_ppc(uint32 entry) void TriggerInterrupt(void) { + idle_resume(); #if 0 WriteMacInt32(0x16a, ReadMacInt32(0x16a) + 1); #else