示例#1
0
        public int sceKernelReceiveMsgPipe(MsgPipe MsgPipe, byte *Message, int Size, int WaitMode, int *ResultSizeAddr,
                                           uint *Timeout)
        {
            if (Timeout != null)
            {
                throw new NotImplementedException();
            }

#if DEBUG_MSG_PIPES
            Console.Error.WriteLine("sceKernelReceiveMsgPipe");
#endif

            bool Transferred = false;
            while (!Transferred)
            {
                try
                {
                    MsgPipe.Dequeue(Message, Size, ResultSizeAddr);
                    Transferred = true;
                }
                catch (SceKernelException)
                {
                    ThreadManager.Current.SetWaitAndPrepareWakeUp(HleThread.WaitType.None, "sceKernelReceiveMsgPipe",
                                                                  MsgPipe, WakeUpCallback =>
                    {
#if DEBUG_MSG_PIPES
                        Console.Error.WriteLine("sceKernelReceiveMsgPipe.wait");
#endif

                        MsgPipe.OnAvailableForRecv.Enqueue(() =>
                        {
#if DEBUG_MSG_PIPES
                            Console.Error.WriteLine("sceKernelReceiveMsgPipe.awake");
#endif
                            WakeUpCallback();
                        });
                    }, HandleCallbacks: false);
                }
            }
            return(0);
        }
 public int sceKernelTryReceiveMsgPipe(MsgPipe MsgPipe, byte* Message, int Size, int WaitMode, int* ResultSizeAddr)
 {
     MsgPipe.Dequeue(Message, Size, ResultSizeAddr);
     return 0;
 }
        public int sceKernelReceiveMsgPipe(MsgPipe MsgPipe, byte* Message, int Size, int WaitMode, int* ResultSizeAddr, uint* Timeout)
        {
            if (Timeout != null) throw(new NotImplementedException());

            #if DEBUG_MSG_PIPES
            Console.Error.WriteLine("sceKernelReceiveMsgPipe");
            #endif

            bool Transferred = false;
            while (!Transferred)
            {
                try
                {
                    MsgPipe.Dequeue(Message, Size, ResultSizeAddr);
                    Transferred = true;
                }
                catch (SceKernelException)
                {
                    ThreadManager.Current.SetWaitAndPrepareWakeUp(HleThread.WaitType.None, "sceKernelReceiveMsgPipe", MsgPipe, WakeUpCallback =>
                    {
            #if DEBUG_MSG_PIPES
                        Console.Error.WriteLine("sceKernelReceiveMsgPipe.wait");
            #endif

                        MsgPipe.OnAvailableForRecv.Enqueue(() =>
                        {
            #if DEBUG_MSG_PIPES
                            Console.Error.WriteLine("sceKernelReceiveMsgPipe.awake");
            #endif
                            WakeUpCallback();
                        });

                    }, HandleCallbacks: false);
                }
            }
            return 0;
        }
示例#4
0
 public int sceKernelTryReceiveMsgPipe(MsgPipe MsgPipe, byte *Message, int Size, int WaitMode,
                                       int *ResultSizeAddr)
 {
     MsgPipe.Dequeue(Message, Size, ResultSizeAddr);
     return(0);
 }