summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 866028b4c..5ddd4e761 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);
+ }
}
//