void Timer::reset() { MUTEX_LOCK(game->timerMutex); time = 0; clearJobs(); MUTEX_UNLOCK(game->timerMutex); }
void WorkerThread::stop() { if (m_Thread) { clearJobs(); m_Thread.reset(); } }
// This is called whenever "Ok" or "Apply" is pressed on the configuration // dialog. If the moodbar is disabled, kill the current process and // clear the queue void MoodServer::slotMoodbarPrefs( bool show, bool moodier, int alter, bool withMusic ) { if( show == true) return; (void) moodier; (void) alter; (void) withMusic; // If we have a current process, kill it. Cleanup happens in // slotJobCompleted() above. We do *not* want to lock the // mutex when calling this! if( m_currentProcess != 0 ) m_currentProcess->kill(); clearJobs(); }
//************************************************************************************************* // Shut down job manager //************************************************************************************************* void JobManager::shutDown(void) { // Stop the manager _runManager = false; // Clear the job queue clearJobs(); // Wait for each thread individually and close the handle on it for(SUINT i = 0; i < _numWorkerThreads; ++i) { WaitForSingleObject(_workerThreads[i], INFINITE); CloseHandle(_workerThreads[i]); } free(_workerThreads); }
// This is called when we decide that the moodbar analyzer is // never going to work. Disable further jobs, and let the user // know about it. This should only be called when m_currentProcess == 0. void MoodServer::setMoodbarBroken( void ) { warning() << "Uh oh, it looks like the moodbar analyzer is not going to work" << endl; Amarok::StatusBar::instance()->longMessage( i18n( "The Amarok moodbar analyzer program seems to be broken. " "This is probably because the moodbar package is not installed " "correctly. The moodbar package, installation instructions, and " "troubleshooting help can be found on the wiki page at <a href='" WEBPAGE "'>" WEBPAGE "</a>. " "When the problem is fixed, please restart Amarok."), KDE::StatusBar::Error ); m_moodbarBroken = true; clearJobs(); }
Timer::~Timer() { clearJobs(); }