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); } }
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 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(); }
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; } }