kernel/eka/nkernsmp/nkerns.cpp
changeset 201 43365a9b78a3
parent 109 b3a1d9898418
equal deleted inserted replaced
200:73ea206103e6 201:43365a9b78a3
   240 		iLastCpu = (TUint8)ss.iCpuNum;
   240 		iLastCpu = (TUint8)ss.iCpuNum;
   241 		iReady = (TUint8)(iLastCpu | EReadyOffset);
   241 		iReady = (TUint8)(iLastCpu | EReadyOffset);
   242 		iCurrent = iReady;
   242 		iCurrent = iReady;
   243 		iCpuAffinity = iLastCpu;
   243 		iCpuAffinity = iLastCpu;
   244 		iEventState = (iLastCpu<<EEventCpuShift) | (iLastCpu<<EThreadCpuShift);
   244 		iEventState = (iLastCpu<<EEventCpuShift) | (iLastCpu<<EThreadCpuShift);
   245 		i_NThread_Initial = TRUE; // must set as initial before 
   245 		i_NThread_Initial = TRUE;	// must set initial thread flag before adding to subscheduler
   246 		ss.SSAddEntry(this);      // adding to subsched list
   246 		ss.SSAddEntry(this);		// in order to get correct ready thread count (i.e. not including the idle thread)
   247 		iACount = 1;
   247 		iACount = 1;
   248 		ss.iInitialThread = (NThread*)this;
   248 		ss.iInitialThread = (NThread*)this;
   249 		NKern::Unlock();		// now that current thread is defined
   249 		NKern::Unlock();		// now that current thread is defined
   250 		}
   250 		}
   251 	else
   251 	else
   536 	return TheScheduler.iRebalanceDfcQ;
   536 	return TheScheduler.iRebalanceDfcQ;
   537 	}
   537 	}
   538 
   538 
   539 NThread* TScheduler::LBThread()
   539 NThread* TScheduler::LBThread()
   540 	{
   540 	{
   541 	return (NThread*)(TheScheduler.iRebalanceDfcQ->iThread);
   541 	TDfcQue* rbQ = TheScheduler.iRebalanceDfcQ;
   542 	}
   542 	return rbQ ? (NThread*)(rbQ->iThread) : 0;
   543 
   543 	}
       
   544