예제 #1
0
        protected void UpdateWaitingThreads()
        {
            foreach (var WaitingThread in WaitingThreads.ToArray())
            {
                uint Matching = 0;
                //Console.Error.WriteLine("");
                //Console.Error.WriteLine("|| " + WaitingThread + " || ");
                //Console.Error.WriteLine("");
                if (Poll(WaitingThread.BitsToMatch, WaitingThread.WaitType, &Matching))
                {
                    if (WaitingThread.OutBits != null)
                    {
                        *WaitingThread.OutBits = Matching;
                    }
                    if (WaitingThread.WaitType.HasFlag(EventFlagWaitTypeSet.Clear))
                    {
                        BitPattern &= ~WaitingThread.BitsToMatch;
                        //Matching
                        //throw(new NotImplementedException());
                    }
                    else if (WaitingThread.WaitType.HasFlag(EventFlagWaitTypeSet.ClearAll))
                    {
                        BitPattern = 0;
                        //throw (new NotImplementedException());
                    }
                    WaitingThreads.Remove(WaitingThread);
                    WaitingThread.WakeUpCallback();
                    //Console.Error.WriteLine("WAKE UP!!");
                }
            }

            Info.NumberOfWaitingThreads = WaitingThreads.Count;
        }
        public int sceKernelCancelEventFlag(HleEventFlag EventFlag, int NewPattern, int *NumWaitThread)
        {
            foreach (var WaitingThread in EventFlag.WaitingThreads)
            {
                WaitingThread.WakeUpCallback();
            }

            //throw(new NotImplementedException());
            return(0);
        }