TProcessPriority convPri( int pri) { TProcessPriority priority = TProcessPriority(-1); if((pri >= UPPER_LIMIT_PRIORITY_LOWEST) && ( pri <= LOWER_LIMIT_PRIORITY_LOWEST)) { priority = EPriorityLow; } else if ((pri >= UPPER_LIMIT_PRIORITY_BELOW_NORMAL) && ( pri <= LOWER_LIMIT_PRIORITY_BELOW_NORMAL)) { priority = EPriorityBackground; } else if((pri >= UPPER_LIMIT_PRIORITY_NORMAL) && ( pri <= LOWER_LIMIT_PRIORITY_NORMAL)) { priority = EPriorityForeground; } else if((pri >= UPPER_LIMIT_PRIORITY_ABOVE_NORMAL) && ( pri <= LOWER_LIMIT_PRIORITY_ABOVE_NORMAL)) { priority = EPriorityHigh; } /* If priority is anything other than this, Symbian wont change it for user process/thread*/ return priority; }
/** Function : CT_MsgServer Description : Constructor @return : N/A */ CT_MsgServer::CT_MsgServer() : CTestServer() , iSharedDataBase(NULL) , iActiveScheduler(NULL) { //Raise process priority to allow complete event logging. RProcess me; me.SetPriority(TProcessPriority(450)); User::SetPriorityControl(EFalse); }