Removed unnecessary lock in the interrupt thread
This commit is contained in:
parent
0007d20b03
commit
bc42cfaa6b
|
@ -52,8 +52,6 @@ xbox::PLIST_ENTRY RemoveTailList(xbox::PLIST_ENTRY pListHead);
|
|||
|
||||
extern xbox::LAUNCH_DATA_PAGE DefaultLaunchDataPage;
|
||||
extern xbox::PKINTERRUPT EmuInterruptList[MAX_BUS_INTERRUPT_LEVEL + 1];
|
||||
inline std::condition_variable g_InterruptSignal;
|
||||
inline std::atomic_bool g_AnyInterruptAsserted = false;
|
||||
|
||||
class HalSystemInterrupt {
|
||||
public:
|
||||
|
@ -64,8 +62,6 @@ public:
|
|||
}
|
||||
|
||||
m_Asserted = state;
|
||||
g_AnyInterruptAsserted = true;
|
||||
g_InterruptSignal.notify_one();
|
||||
};
|
||||
|
||||
void Enable() {
|
||||
|
|
|
@ -337,17 +337,14 @@ static xbox::void_xt NTAPI CxbxKrnlInterruptThread(xbox::PVOID param)
|
|||
InitSoftwareInterrupts();
|
||||
#endif
|
||||
|
||||
std::mutex m;
|
||||
std::unique_lock<std::mutex> lock(m);
|
||||
while (true) {
|
||||
for (int i = 0; i < MAX_BUS_INTERRUPT_LEVEL; i++) {
|
||||
// If the interrupt is pending and connected, process it
|
||||
if (HalSystemInterrupts[i].IsPending() && EmuInterruptList[i] && EmuInterruptList[i]->Connected) {
|
||||
if (g_bEnableAllInterrupts && HalSystemInterrupts[i].IsPending() && EmuInterruptList[i] && EmuInterruptList[i]->Connected) {
|
||||
HalSystemInterrupts[i].Trigger(EmuInterruptList[i]);
|
||||
}
|
||||
}
|
||||
g_InterruptSignal.wait(lock, []() { return g_AnyInterruptAsserted.load() && g_bEnableAllInterrupts.load(); });
|
||||
g_AnyInterruptAsserted = false;
|
||||
_mm_pause();
|
||||
}
|
||||
|
||||
assert(0);
|
||||
|
|
Loading…
Reference in New Issue