mirror of
https://github.com/holub/mame
synced 2025-10-08 17:37:56 +03:00
schedule.c: make yield() actually yield again, rather than be a synonym for spin() [Alex Jackson]
This commit is contained in:
parent
c96e0ca32a
commit
4c148ffb50
@ -415,7 +415,7 @@ void device_scheduler::timeslice()
|
|||||||
bool call_debugger = ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
|
bool call_debugger = ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
|
||||||
|
|
||||||
// build the execution list if we don't have one yet
|
// build the execution list if we don't have one yet
|
||||||
if (m_execute_list == NULL)
|
if (UNEXPECTED(m_execute_list == NULL))
|
||||||
rebuild_execute_list();
|
rebuild_execute_list();
|
||||||
|
|
||||||
// if the current quantum has expired, find a new one
|
// if the current quantum has expired, find a new one
|
||||||
@ -439,11 +439,12 @@ void device_scheduler::timeslice()
|
|||||||
if (m_suspend_changes_pending)
|
if (m_suspend_changes_pending)
|
||||||
apply_suspend_changes();
|
apply_suspend_changes();
|
||||||
|
|
||||||
// loop over non-suspended CPUs
|
// loop over all CPUs
|
||||||
for (device_execute_interface *exec = m_execute_list; exec != NULL; exec = exec->m_nextexec)
|
for (device_execute_interface *exec = m_execute_list; exec != NULL; exec = exec->m_nextexec)
|
||||||
{
|
{
|
||||||
// only process if our target is later than the CPU's current time (coarse check)
|
// only process if this CPU is executing or truly halted (not yielding)
|
||||||
if (target.seconds >= exec->m_localtime.seconds)
|
// and if our target is later than the CPU's current time (coarse check)
|
||||||
|
if (EXPECTED((exec->m_suspend == 0 || exec->m_eatcycles) && target.seconds >= exec->m_localtime.seconds))
|
||||||
{
|
{
|
||||||
// compute how many attoseconds to execute this CPU
|
// compute how many attoseconds to execute this CPU
|
||||||
attoseconds_t delta = target.attoseconds - exec->m_localtime.attoseconds;
|
attoseconds_t delta = target.attoseconds - exec->m_localtime.attoseconds;
|
||||||
|
Loading…
Reference in New Issue
Block a user