summaryrefslogtreecommitdiff
path: root/EmulatorPkg/CpuRuntimeDxe
diff options
context:
space:
mode:
authorChen Fan <chen.fan.fnst@cn.fujitsu.com>2014-07-22 08:19:43 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-07-22 08:19:43 +0000
commit70a2c7b11cbd6b1ad1fcb57b6f2011d534303984 (patch)
treece5903788d0575b384f36b932b70ea601430ccbe /EmulatorPkg/CpuRuntimeDxe
parentf1bc233ae1255d64ce65948a208ab4b7810b01d4 (diff)
downloadedk2-platforms-70a2c7b11cbd6b1ad1fcb57b6f2011d534303984.tar.xz
EmulatorPkg/MpService: modify AP state should hold a mutex
Add mutex when change AP state. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15668 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmulatorPkg/CpuRuntimeDxe')
-rw-r--r--EmulatorPkg/CpuRuntimeDxe/MpService.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/EmulatorPkg/CpuRuntimeDxe/MpService.c b/EmulatorPkg/CpuRuntimeDxe/MpService.c
index 792d0e4eb0..9d67b86ddf 100644
--- a/EmulatorPkg/CpuRuntimeDxe/MpService.c
+++ b/EmulatorPkg/CpuRuntimeDxe/MpService.c
@@ -512,11 +512,16 @@ CpuMpServicesStartupAllAps (
if (SingleThread) {
Status = GetNextBlockedNumber (&NextNumber);
if (!EFI_ERROR (Status)) {
+ gThread->MutexLock (&gMPSystem.ProcessorData[NextNumber].StateLock);
gMPSystem.ProcessorData[NextNumber].State = CPU_STATE_READY;
+ gThread->MutexUnlock (&gMPSystem.ProcessorData[NextNumber].StateLock);
}
}
+ gThread->MutexLock (ProcessorData->StateLock);
ProcessorData->State = CPU_STATE_IDLE;
+ gThread->MutexUnlock (ProcessorData->StateLock);
+
break;
default: