Skip to content

Commit

Permalink
suspend processors while waiting
Browse files Browse the repository at this point in the history
  • Loading branch information
soyersoyer committed Jan 24, 2025
1 parent dcdbe3d commit 598a157
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/minidexed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ void CMiniDexed::Run (unsigned nCore)
{
while (m_CoreStatus[nCore] != CoreStatusIdle)
{
// just wait
WaitForEvent ();
}
}

Expand All @@ -449,9 +449,11 @@ void CMiniDexed::Run (unsigned nCore)
while (1)
{
m_CoreStatus[nCore] = CoreStatusIdle; // ready to be kicked
SendIPI (1, IPI_USER);

while (m_CoreStatus[nCore] == CoreStatusIdle)
{
// just wait
WaitForEvent ();
}

// now kicked from core 1
Expand Down Expand Up @@ -1230,6 +1232,7 @@ void CMiniDexed::ProcessSound (void)
{
assert (m_CoreStatus[nCore] == CoreStatusIdle);
m_CoreStatus[nCore] = CoreStatusBusy;
SendIPI (nCore, IPI_USER);
}

// process the TGs assigned to core 1
Expand All @@ -1245,7 +1248,7 @@ void CMiniDexed::ProcessSound (void)
{
while (m_CoreStatus[nCore] != CoreStatusIdle)
{
// just wait
WaitForEvent ();
}
}

Expand Down

0 comments on commit 598a157

Please sign in to comment.