Tentative fixes to BeOS idle suspend/resume routines. Well, I have no-op'ed

them. So, if someone has BeOS and wants to give it a try, please change and
test this new code. Corner case could be a resume_thread() when emul_thread
is not suspended.

Fixlet to powerrom_cpu: call idle_resume() from TriggerInterrupt().
This commit is contained in:
gbeauche 2006-04-30 21:26:21 +00:00
parent 4f07113555
commit 5aa8c9f86f
2 changed files with 18 additions and 1 deletions

View File

@ -28,6 +28,10 @@
#include "debug.h"
// From main_beos.cpp
extern thread_id emul_thread;
/*
* Return microseconds since boot (64 bit)
*/
@ -138,7 +142,15 @@ void Delay_usec(uint32 usec)
void idle_wait(void)
{
sleep(16667);
#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
}
@ -148,4 +160,7 @@ void idle_wait(void)
void idle_resume(void)
{
#if 0
resume_thread(emul_thread);
#endif
}

View File

@ -31,6 +31,7 @@
#include "main.h"
#include "emul_op.h"
#include "prefs.h"
#include "timer.h"
#include "user_strings.h"
#include "sheep_driver.h"
@ -1238,6 +1239,7 @@ void Start680x0(void)
void TriggerInterrupt(void)
{
idle_resume();
if (emul_thread > 0 && ReadyForSignals)
send_signal(emul_thread, SIGUSR1);
}