Esempio n. 1
0
        public ER chg_pri(ID tskid, PRI tskpri)
        {
            ER Result = ER.E_NOEXS;
            Task Task;

            if (g_Kernel == null)
                return ER.E_DLT;

            g_Kernel.LockCPU();
            try {
                Task = g_Kernel.Nucleus.GetTask(tskid);
                if (Task == null)
                    Result = ER.E_NOEXS;
                else
                    Result = Task.ChangePriority(tskpri);
            }
            finally {
                g_Kernel.UnlockCPU();
            }

            return Result;
        }
Esempio n. 2
0
        public ER rot_rdq(PRI tskpri)
        {
            ER result = ER.E_NOEXS;
            Task task;

            if (g_Kernel == null)
                return ER.E_DLT;

            g_Kernel.LockCPU();
            try {
                task = g_Kernel.Nucleus.GetTask(ID.TSK_SELF);

                if (task == null)
                    result = ER.E_CTX;
                else
                    result = task.RotateReadyQueue(tskpri);
            }
            finally {
                g_Kernel.UnlockCPU();
            }

            return result;
        }