diff options
author | Chen Fan <chen.fan.fnst@cn.fujitsu.com> | 2014-07-22 08:19:43 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-07-22 08:19:43 +0000 |
commit | 70a2c7b11cbd6b1ad1fcb57b6f2011d534303984 (patch) | |
tree | ce5903788d0575b384f36b932b70ea601430ccbe /EmulatorPkg/CpuRuntimeDxe | |
parent | f1bc233ae1255d64ce65948a208ab4b7810b01d4 (diff) | |
download | edk2-70a2c7b11cbd6b1ad1fcb57b6f2011d534303984.zip edk2-70a2c7b11cbd6b1ad1fcb57b6f2011d534303984.tar.gz edk2-70a2c7b11cbd6b1ad1fcb57b6f2011d534303984.tar.bz2 |
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/EmulatorPkg/CpuRuntimeDxe/MpService.c b/EmulatorPkg/CpuRuntimeDxe/MpService.c index 792d0e4..9d67b86 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:
|