Exemple #1
0
 public bool Matches(uint userValue, KWaitType waitType)
 {
     if ((( int )waitType & 0x1) == ( int )KWaitType.And)
     {
         // &
         return((Value & userValue) == userValue);
     }
     else
     {
         // |
         Debug.Assert((waitType & KWaitType.Or) == KWaitType.Or);
         return((Value & userValue) > 0);
     }
 }
Exemple #2
0
        public bool Clear(uint userValue, KWaitType waitType)
        {
            if ((waitType & KWaitType.ClearAll) != 0)
            {
                this.Value = 0;
                return(true);
            }
            else if ((waitType & KWaitType.ClearPattern) != 0)
            {
                this.Value = this.Value & ~userValue;
                return(true);
            }

            return(false);
        }
Exemple #3
0
        public bool Clear(uint userValue, KWaitType waitType)
        {
            if ((waitType & KWaitType.ClearAll) != 0)
            {
                this.Value = 0;
                return true;
            }
            else if ((waitType & KWaitType.ClearPattern) != 0)
            {
                this.Value = this.Value & ~userValue;
                return true;
            }

            return false;
        }
        public void Wait(KEvent ev, KWaitType waitEventMode, uint userValue, uint outAddress, uint timeoutUs, bool canHandleCallbacks)
        {
            State = KThreadState.Waiting;
            this.RemoveFromSchedule();

            CanHandleCallbacks = canHandleCallbacks;

            ev.WaitingThreads.Enqueue(this);

            WaitingOn = KThreadWait.Event;
            this.WaitTimeoutSetup(timeoutUs);
            WaitHandle    = ev;
            WaitEventMode = waitEventMode;
            WaitArgument  = userValue;
            WaitAddress   = outAddress;

            if (canHandleCallbacks == true)
            {
                this.Kernel.CheckCallbacks();
            }

            this.Kernel.Schedule();
        }
        public void Wait( KEvent ev, KWaitType waitEventMode, uint userValue, uint outAddress, uint timeoutUs, bool canHandleCallbacks )
        {
            State = KThreadState.Waiting;
            this.RemoveFromSchedule();

            CanHandleCallbacks = canHandleCallbacks;

            ev.WaitingThreads.Enqueue( this );

            WaitingOn = KThreadWait.Event;
            this.WaitTimeoutSetup( timeoutUs );
            WaitHandle = ev;
            WaitEventMode = waitEventMode;
            WaitArgument = userValue;
            WaitAddress = outAddress;

            if( canHandleCallbacks == true )
                this.Kernel.CheckCallbacks();

            this.Kernel.Schedule();
        }
Exemple #6
0
 public bool Matches( uint userValue, KWaitType waitType )
 {
     if( ( ( int )waitType & 0x1 ) == ( int )KWaitType.And )
     {
         // &
         return ( Value & userValue ) == userValue;
     }
     else
     {
         // |
         Debug.Assert( ( waitType & KWaitType.Or ) == KWaitType.Or );
         return (Value & userValue) > 0;
     }
 }