kernel/eka/kernel/sprocess.cpp
branchRCL_3
changeset 42 a179b74831c9
parent 0 a41df078684a
child 43 c1f20ce4abcf
--- a/kernel/eka/kernel/sprocess.cpp	Thu Jul 15 20:11:42 2010 +0300
+++ b/kernel/eka/kernel/sprocess.cpp	Thu Aug 19 11:14:22 2010 +0300
@@ -590,6 +590,16 @@
 		pLink=pLink->iNext;
 		if (pT!=pC)
 			{
+			// If killing pT will cause a system crash then force that to happen in the context of the
+			// current thread
+			if(pT->iFlags & KThreadFlagSystemPermanent)
+				{
+				K::Fault(K::EPermanentThreadExit);
+				}
+			if (aType != EExitKill && (pT->iFlags & KThreadFlagSystemCritical))
+				{
+				K::Fault(K::ESystemThreadPanic);
+				}
 			// Need to stop the current thread being killed as a consequence of killing pT
 			pT->iFlags &= ~(KThreadFlagProcessPermanent|KThreadFlagProcessCritical);
 			pT->Die(aType, aReason, aCategory);