本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
*/
}
示例6: finalizeCallback
public void finalizeCallback(CpuThreadState CpuThreadState)
{
CpuThreadState.CpuProcessor.RunningCallback = false;
CpuThreadState.Yield();
//throw (new HleEmulatorFinalizeCallbackException());
}
示例7: sceKernelRotateThreadReadyQueue
public int sceKernelRotateThreadReadyQueue(CpuThreadState CpuThreadState, int priority)
{
// @TODO!
//throw(new NotImplementedException());
CpuThreadState.Yield();
return 0;
}
示例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;
}
示例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;
}
示例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;
}