CSPspEmu.Hle.Modules.threadman.ThreadManForUser.sceKernelPollSema C# (CSharp) Метод

sceKernelPollSema() приватный Метод

private sceKernelPollSema ( CpuThreadState CpuThreadState, SemaphoreId SemaphoreId, int Signal ) : int
CpuThreadState CSPspEmu.Core.Cpu.CpuThreadState
SemaphoreId SemaphoreId
Signal int
Результат int
        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 (Signal > Semaphore.CurrentCount)
            {
                //ThreadManager.Reschedule();
                //CpuThreadState.Yield();
                throw (new SceKernelException(SceKernelErrors.ERROR_KERNEL_SEMA_ZERO));
                //return 0;
            }
            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;
            }
            */
        }
ThreadManForUser