kernel/eka/nkernsmp/dfcs.cpp
branchRCL_3
changeset 43 c1f20ce4abcf
parent 0 a41df078684a
child 44 3e88ff8f41d5
--- a/kernel/eka/nkernsmp/dfcs.cpp	Thu Aug 19 11:14:22 2010 +0300
+++ b/kernel/eka/nkernsmp/dfcs.cpp	Tue Aug 31 16:34:26 2010 +0300
@@ -765,6 +765,23 @@
 						}
 					ss->iExIDfcLock.UnlockOnly();
 					if (kick)
+						{
+						TScheduler& s = TheScheduler;
+						TUint32 cpuMask = 1u<<cpu;
+						if (!(s.iThreadAcceptCpus & cpuMask))	// deal with case where target CPU is shutting down or has already shut down
+							{
+							TInt irq = s.iGenIPILock.LockIrqSave();
+							if (!(s.iIpiAcceptCpus & cpuMask))
+								{
+								s.iCCReactivateCpus |= cpuMask;
+								kick = FALSE;
+								}
+							s.iGenIPILock.UnlockIrqRestore(irq);
+							if (!kick)
+								s.iCCReactivateDfc.DoEnque();	// arrange for target CPU to be powered on
+							}
+						}
+					if (kick)
 						send_resched_ipi(cpu);
 					NKern::EnableAllInterrupts();	// let interrupts in
 					if (orig >= 8)