~Manager () { signalThreadShouldExit (); notify (); waitForThreadToExit (); bassert (m_items.empty ()); }
~SharedMessageThread() { signalThreadShouldExit(); JUCEApplication::quit(); waitForThreadToExit (5000); clearSingletonInstance(); }
void SerialOscController::stop(void) { if (socket != nullptr) { socket->AsynchronousBreak(); waitForThreadToExit(1000); socket = nullptr; } }
void WebInterface::stop() { char outbuf[128]; outbuf[0] = 0; mg_write(_conn, outbuf, 1); signalThreadShouldExit(); waitForThreadToExit(-1); }
void Thread::stopThread () { std::lock_guard<std::recursive_mutex> sl (startStopLock); if (isThreadRunning()) { signalThreadShouldExit(); notify(); waitForThreadToExit (); } }
bool RHD2000Thread::stopAcquisition() { // isTransmitting = false; std::cout << "RHD2000 data thread stopping acquisition." << std::endl; if (isThreadRunning()) { signalThreadShouldExit(); } if (waitForThreadToExit(500)) { std::cout << "Thread exited." << std::endl; } else { std::cout << "Thread failed to exit, continuing anyway..." << std::endl; } if (deviceFound) { evalBoard->setContinuousRunMode(false); evalBoard->setMaxTimeStep(0); std::cout << "Flushing FIFO." << std::endl; evalBoard->flush(); // evalBoard->setContinuousRunMode(true); // evalBoard->run(); } dataBuffer->clear(); if (deviceFound) { cout << "Number of 16-bit words in FIFO: " << evalBoard->numWordsInFifo() << endl; // std::cout << "Stopped eval board." << std::endl; int ledArray[8] = {1, 0, 0, 0, 0, 0, 0, 0}; evalBoard->setLedDisplay(ledArray); } isTransmitting = false; return true; }
bool Thread::stopThread (const int timeOutMilliseconds) { bool cleanExit = true; // agh! You can't stop the thread that's calling this method! How on earth // would that work?? bassert (getCurrentThreadId() != getThreadId()); const RecursiveMutex::ScopedLockType sl (startStopLock); if (isThreadRunning()) { signalThreadShouldExit(); notify(); if (timeOutMilliseconds != 0) { cleanExit = waitForThreadToExit (timeOutMilliseconds); } if (isThreadRunning()) { bassert (! cleanExit); // very bad karma if this point is reached, as there are bound to be // locks and events left in silly states when a thread is killed by force.. killThread(); threadHandle = nullptr; threadId = 0; cleanExit = false; } else { cleanExit = true; } } return cleanExit; }
void SocketListener::stopListening() { signalThreadShouldExit(); socket = nullptr; waitForThreadToExit(0); }
void Sequencer::stop() { signalThreadShouldExit(); waitForThreadToExit(-1); }