diff options
-rw-r--r-- | EmulatorPkg/CpuRuntimeDxe/MpService.c | 8 |
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);
+ }
}
//
|