예제 #1
0
        private void SvcSleepThread(AThreadState ThreadState)
        {
            long Timeout = (long)ThreadState.X0;

            Device.Log.PrintDebug(LogClass.KernelSvc, "Timeout = 0x" + Timeout.ToString("x16"));

            KThread CurrentThread = System.Scheduler.GetCurrentThread();

            if (Timeout < 1)
            {
                switch (Timeout)
                {
                case  0: CurrentThread.Yield();                        break;

                case -1: CurrentThread.YieldWithLoadBalancing();       break;

                case -2: CurrentThread.YieldAndWaitForLoadBalancing(); break;
                }
            }
            else
            {
                CurrentThread.Sleep(Timeout);

                ThreadState.X0 = 0;
            }
        }
예제 #2
0
        private void SvcSleepThread(CpuThreadState threadState)
        {
            long timeout = (long)threadState.X0;

            Logger.PrintDebug(LogClass.KernelSvc, "Timeout = 0x" + timeout.ToString("x16"));

            KThread currentThread = _system.Scheduler.GetCurrentThread();

            if (timeout < 1)
            {
                switch (timeout)
                {
                case  0: currentThread.Yield();                        break;

                case -1: currentThread.YieldWithLoadBalancing();       break;

                case -2: currentThread.YieldAndWaitForLoadBalancing(); break;
                }
            }
            else
            {
                currentThread.Sleep(timeout);

                threadState.X0 = 0;
            }
        }