void StandbyThread::StopAsync() { assert(!IsInside()); assert(mutex.IsLockedByCurrent()); stop = true; /* clear the queued work */ pending = false; TriggerCommand(); }
void StandbyThread::Trigger() { assert(!IsInside()); assert(mutex.IsLockedByCurrent()); stop = false; pending = true; if (alive) TriggerCommand(); else /* start it if it's not running currently */ alive = Start(); }
// This method receives keys not handled directly by the original receiver and // distributes them to interested listeners // p_vKeyStatus is true for a pressed key and false for a released key // returns true if anyone handles the key // update: The return value no longer means anything bool EMKeyboard::NotifyKey(EMGUIComponent* p_opOrigin, char p_vKey, bool p_vKeyStatus, uint32 p_vModifiers) { //m_opSemaphore -> Acquire(); m_oKey.m_opOrigin = p_opOrigin; m_oKey.m_vKey = p_vKey; m_oKey.m_vKeyStatus = p_vKeyStatus; m_oKey.m_vModifiers = p_vModifiers; m_vProcessKey = true; // m_opThread -> Start(); if(m_oKey.m_vKeyStatus) Notify(EM_KEY_DOWN); else Notify(EM_KEY_UP); if(m_oKey.m_vKeyStatus) // Key is pressed TriggerCommand(m_oKey); else // Key is released EMCommandRepository::Instance() -> SetKeyReleased(); //m_opSemaphore -> Release(); return true; }