Comment 11 for bug 883374

Revision history for this message
Daniel Schürmann (daschuer) wrote :

> People want to save and send and then they want to compress and what ever so easier would be that things are not sleeping but just rised when needed.

I do not understand this comment.

Basically this bug is already solved because we have now our own thread for shoutcast,
which can sleep or wait for all other condition as require, without bad effects for other thread.

Here some details to the wait() issue:
http://stackoverflow.com/questions/20073401/what-is-the-use-of-qthread-wait-function

We may add a band aid for the pending wait issue like that:

    m_pShoutcastEnabled->set(0);
    m_readSema.release();
    wait(); // until the thread ends.
    if(!wait(5000)) { // Wait until it actually has terminated (max. 5 sec)
        qWarning("Thread deadlock detected, bad things may happen !!!");
        terminate(); // Thread didn't exit in time, probably deadlocked, terminate it!
        wait(); // Note: We have to wait again here!
    }

But finding and solving the deadlock makes much more sends.
Terminate() will probably stop the tread in the middle of a critical system call which will makes remaining Mixxx unstable, since a thread is not an encapsulated process.