summaryrefslogtreecommitdiff
path: root/EmulatorPkg/CpuRuntimeDxe
diff options
context:
space:
mode:
Diffstat (limited to 'EmulatorPkg/CpuRuntimeDxe')
-rw-r--r--EmulatorPkg/CpuRuntimeDxe/MpService.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/EmulatorPkg/CpuRuntimeDxe/MpService.c b/EmulatorPkg/CpuRuntimeDxe/MpService.c
index 866028b4c2..5ddd4e761e 100644
--- a/EmulatorPkg/CpuRuntimeDxe/MpService.c
+++ b/EmulatorPkg/CpuRuntimeDxe/MpService.c
@@ -465,7 +465,13 @@ CpuMpServicesStartupAllAps (
continue;
}
- SetApProcedure (ProcessorData, Procedure, ProcedureArgument);
+ gThread->MutexLock (ProcessorData->StateLock);
+ ProcessorState = ProcessorData->State;
+ gThread->MutexUnlock (ProcessorData->StateLock);
+
+ if (ProcessorState == CPU_STATE_READY) {
+ SetApProcedure (ProcessorData, Procedure, ProcedureArgument);
+ }
}
//