Ejemplo n.º 1
0
        private void _DelayIo(IoDelayType IoDelayType, long DataSize = 1)
        {
            //return;

            var TimeSpan = IoDelayType.GetTimePerSize(DataSize);

            //Console.WriteLine("_DelayIo: {0}, {1} : {2}", IoDelayType, DataSize, TimeSpan);

            if (TimeSpan != TimeSpan.Zero)
            {
                var CurrentThread = ThreadManager.Current;
                if (CurrentThread != null)
                {
                    //ThreadManager
                    CurrentThread.SetWaitAndPrepareWakeUp(HleThread.WaitType.Timer, "_DelayIo", null, WakeUpCallback =>
                    {
                        PspRtc.RegisterTimerInOnce(TimeSpan, () =>
                        {
                            WakeUpCallback();
                        });
                    }, HandleCallbacks: false);
                }
            }
            else
            {
                ThreadManager.Yield();
            }
        }
Ejemplo n.º 2
0
        private void _DelayIo(IoDelayType IoDelayType, long DataSize = 1)
        {
            //return;

            var TimeSpan = IoDelayType.GetTimePerSize(DataSize);

            //Console.WriteLine("_DelayIo: {0}, {1} : {2}", IoDelayType, DataSize, TimeSpan);

            if (TimeSpan != TimeSpan.Zero)
            {
                var CurrentThread = ThreadManager.Current;
                //ThreadManager
                CurrentThread?.SetWaitAndPrepareWakeUp(HleThread.WaitType.Timer, "_DelayIo", null,
                                                       WakeUpCallback => { PspRtc.RegisterTimerInOnce(TimeSpan, WakeUpCallback); },
                                                       HandleCallbacks: false);
            }
            else
            {
                ThreadManager.Yield();
            }
        }
Ejemplo n.º 3
0
        private void _DelayIo(IoDelayType ioDelayType, long dataSize = 1)
        {
            if (!PspHleRunningConfig.EnableDelayIo)
            {
                return;
            }

            var timeSpan = ioDelayType.GetTimePerSize(dataSize);

            //Console.WriteLine("_DelayIo: {0}, {1} : {2}", IoDelayType, DataSize, TimeSpan);

            if (timeSpan != TimeSpan.Zero)
            {
                var currentThread = ThreadManager.Current;
                //ThreadManager
                currentThread?.SetWaitAndPrepareWakeUp(HleThread.WaitType.Timer, "_DelayIo", null,
                                                       WakeUpCallback => { PspRtc.RegisterTimerInOnce(timeSpan, WakeUpCallback); },
                                                       HandleCallbacks: false);
            }
            else
            {
                ThreadManager.Yield();
            }
        }