--- BasiliskII/src/BeOS/timer_beos.cpp 2005/01/30 21:42:13 1.11 +++ BasiliskII/src/BeOS/timer_beos.cpp 2008/01/01 09:40:32 1.14 @@ -1,7 +1,7 @@ /* * timer_beos.cpp - Time Manager emulation, BeOS specific stuff * - * Basilisk II (C) 1997-2005 Christian Bauer + * Basilisk II (C) 1997-2008 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,10 @@ #include "debug.h" +// From main_beos.cpp +extern thread_id emul_thread; + + /* * Return microseconds since boot (64 bit) */ @@ -130,3 +134,33 @@ void Delay_usec(uint32 usec) { snooze(usec); } + + +/* + * Suspend emulator thread, virtual CPU in idle mode + */ + +void idle_wait(void) +{ +#if 0 + /* + FIXME: add a semaphore (counter) to avoid a B_BAD_THREAD_STATE + return if we call idle_resume() when thread is not suspended? + + Sorry, I can't test -- gb. + */ + suspend_thread(emul_thread); +#endif +} + + +/* + * Resume execution of emulator thread, events just arrived + */ + +void idle_resume(void) +{ +#if 0 + resume_thread(emul_thread); +#endif +}