コード例 #1
0
ファイル: DeadlineTimer.cpp プロジェクト: xdv/divvyd
 ~Manager ()
 {
     signalThreadShouldExit ();
     notify ();
     waitForThreadToExit ();
     bassert (m_items.empty ());
 }
コード例 #2
0
 ~SharedMessageThread()
 {
     signalThreadShouldExit();
     JUCEApplication::quit();
     waitForThreadToExit (5000);
     clearSingletonInstance();
 }
コード例 #3
0
void SerialOscController::stop(void)
{
	if (socket != nullptr) {
		socket->AsynchronousBreak();
		waitForThreadToExit(1000);
		socket = nullptr;
	}
}
コード例 #4
0
ファイル: WebInterface.cpp プロジェクト: eriser/rejuce
void WebInterface::stop()
{
	char outbuf[128];
	outbuf[0] = 0;
	mg_write(_conn, outbuf, 1);

	signalThreadShouldExit();
	waitForThreadToExit(-1);
}
コード例 #5
0
ファイル: Thread.cpp プロジェクト: bachase/rippled
void Thread::stopThread ()
{
    std::lock_guard<std::recursive_mutex> sl (startStopLock);

    if (isThreadRunning())
    {
        signalThreadShouldExit();
        notify();
        waitForThreadToExit ();
    }
}
コード例 #6
0
ファイル: RHD2000Thread.cpp プロジェクト: Rummell/GUI
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;
}
コード例 #7
0
ファイル: Thread.cpp プロジェクト: 619213152/vpal20
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;
}
コード例 #8
0
void SocketListener::stopListening() {
    signalThreadShouldExit();
    socket = nullptr;
    waitForThreadToExit(0);
    
}
コード例 #9
0
ファイル: Sequencer.cpp プロジェクト: eriser/rejuce
void Sequencer::stop()
{
	signalThreadShouldExit();
	waitForThreadToExit(-1);
}