当前位置: 首页>>代码示例>>C#>>正文


C# CpuThreadState.Yield方法代码示例

本文整理汇总了C#中CSPspEmu.Core.Cpu.CpuThreadState.Yield方法的典型用法代码示例。如果您正苦于以下问题:C# CpuThreadState.Yield方法的具体用法?C# CpuThreadState.Yield怎么用?C# CpuThreadState.Yield使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSPspEmu.Core.Cpu.CpuThreadState的用法示例。


在下文中一共展示了CpuThreadState.Yield方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: waitThreadForever

 public void waitThreadForever(CpuThreadState CpuThreadState)
 {
     var SleepThread = HleState.ThreadManager.Current;
     SleepThread.CurrentStatus = HleThread.Status.Waiting;
     SleepThread.CurrentWaitType = HleThread.WaitType.None;
     CpuThreadState.Yield();
 }
开发者ID:mrcmunir,项目名称:cspspemu,代码行数:7,代码来源:Emulator.cs

示例2: sceKernelChangeThreadPriority

 public int sceKernelChangeThreadPriority(CpuThreadState CpuThreadState, int ThreadId, int Priority)
 {
     GetThreadById(ThreadId).PriorityValue = Priority;
     HleState.ThreadManager.Reschedule();
     CpuThreadState.Yield();
     //throw(new NotImplementedException());
     return 0;
 }
开发者ID:mrcmunir,项目名称:cspspemu,代码行数:8,代码来源:ThreadManForUser.Threads.cs

示例3: sceKernelSignalSema

		public int sceKernelSignalSema(CpuThreadState CpuThreadState, SemaphoreId SemaphoreId, int Signal)
		{
			//Console.Error.WriteLine("sceKernelSignalSema!");
			var HleSemaphore = GetSemaphoreById(SemaphoreId);
			if (HleSemaphore.IncrementCount(Signal) > 0)
			{
				CpuThreadState.Yield();
			}
			return 0;
		}
开发者ID:shin527,项目名称:cspspemu,代码行数:10,代码来源:ThreadManForUser.Semaphores.cs

示例4: sceKernelDeleteSema

        public int sceKernelDeleteSema(CpuThreadState CpuThreadState, SemaphoreId SemaphoreId)
        {
            var HleSemaphore = GetSemaphoreById(SemaphoreId);
            SemaphoreManager.Semaphores.Remove((int)SemaphoreId);
            if (HleSemaphore.IncrementCount(HleSemaphore.SceKernelSemaInfo.MaximumCount) > 0)
            {
                CpuThreadState.Yield();
            }

            return 0;
        }
开发者ID:e-COS,项目名称:cspspemu,代码行数:11,代码来源:ThreadManForUser.Semaphores.cs

示例5: sceKernelPollSema

        public int sceKernelPollSema(CpuThreadState CpuThreadState, SemaphoreId SemaphoreId, int Signal)
        {
            var Semaphore = GetSemaphoreById(SemaphoreId);
            if (Signal <= 0) throw(new SceKernelException(SceKernelErrors.ERROR_KERNEL_ILLEGAL_COUNT));
            if (Semaphore.CurrentCount - Signal < 0)
            {
                //ThreadManager.Reschedule();
                CpuThreadState.Yield();
                throw (new SceKernelException(SceKernelErrors.ERROR_KERNEL_SEMA_ZERO));
            }
            Semaphore.IncrementCount(-Signal);
            //throw(new NotImplementedException());
            return 0;
            /*
            try {
                PspSemaphore pspSemaphore = uniqueIdFactory.get!PspSemaphore(semaid);

                if (pspSemaphore.info.currentCount - signal < 0) return SceKernelErrors.ERROR_KERNEL_SEMA_ZERO;

                pspSemaphore.info.currentCount -= signal;
                return 0;
            } catch (UniqueIdNotFoundException) {
                return SceKernelErrors.ERROR_KERNEL_NOT_FOUND_SEMAPHORE;
            }
            */
        }
开发者ID:e-COS,项目名称:cspspemu,代码行数:26,代码来源:ThreadManForUser.Semaphores.cs

示例6: finalizeCallback

 public void finalizeCallback(CpuThreadState CpuThreadState)
 {
     CpuThreadState.CpuProcessor.RunningCallback = false;
     CpuThreadState.Yield();
     //throw (new HleEmulatorFinalizeCallbackException());
 }
开发者ID:SsJVasto,项目名称:cspspemu,代码行数:6,代码来源:Emulator.cs

示例7: sceKernelRotateThreadReadyQueue

		public int sceKernelRotateThreadReadyQueue(CpuThreadState CpuThreadState, int priority)
		{
			// @TODO!
			//throw(new NotImplementedException());
			CpuThreadState.Yield();
			return 0;
		}
开发者ID:Falaina,项目名称:cspspemu,代码行数:7,代码来源:ThreadManForUser.Threads.cs

示例8: sceKernelChangeThreadPriority

		public int sceKernelChangeThreadPriority(CpuThreadState CpuThreadState, int ThreadId, int Priority)
		{
			var Thread = GetThreadById(ThreadId);
			Thread.PriorityValue = Priority;
			CpuThreadState.Yield();
			//throw(new NotImplementedException());
			return 0;
		}
开发者ID:Falaina,项目名称:cspspemu,代码行数:8,代码来源:ThreadManForUser.Threads.cs

示例9: sceKernelStartThread

		public int sceKernelStartThread(CpuThreadState CpuThreadState, int ThreadId, int UserDataLength, uint UserDataPointer)
		{
			var ThreadToStart = GetThreadById((int)ThreadId);
			_sceKernelStartThread(CpuThreadState, ThreadId, UserDataLength, UserDataPointer);
			// Schedule new thread?
			CpuThreadState.Yield();
			return 0;
		}
开发者ID:Falaina,项目名称:cspspemu,代码行数:8,代码来源:ThreadManForUser.Threads.cs

示例10: sceKernelStartThread

        public int sceKernelStartThread(CpuThreadState CpuThreadState, int ThreadId, uint ArgumentsLength, uint ArgumentsPointer)
        {
            var ThreadToStart = GetThreadById((int)ThreadId);
            //Console.WriteLine("LEN: {0:X}", ArgumentsLength);
            //Console.WriteLine("PTR: {0:X}", ArgumentsPointer);
            ThreadToStart.CpuThreadState.GPR[4] = (int)ArgumentsLength;
            ThreadToStart.CpuThreadState.GPR[5] = (int)ArgumentsPointer;
            ThreadToStart.CurrentStatus = HleThread.Status.Ready;

            // Schedule new thread?
            HleState.ThreadManager.ScheduleNext(ThreadToStart);
            CpuThreadState.Yield();
            return 0;
        }
开发者ID:mrcmunir,项目名称:cspspemu,代码行数:14,代码来源:ThreadManForUser.Threads.cs


注:本文中的CSPspEmu.Core.Cpu.CpuThreadState.Yield方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。