[Qt-interest] qtmutex locked - application waits??

caius ligarius caius9090 at gmail.com
Tue May 25 03:12:30 CEST 2010


Hi,

I see something strange happening in my application. When I try to select
QComboBox item in my application it just waits or freezes for a few seconds
and doesn't let me do anything. After pausing the code in run-time I noticed
that the app is getting stuck in void QMutex::unlock() function-

void QMutex::unlock()
{
    Q_ASSERT_X(d->owner == QThread::currentThreadId(), "QMutex::unlock()",
               "A mutex must be unlocked in the same thread that locked
it.");

    if (d->recursive) {
        if (!--d->count) {
            d->owner = 0;
            if (!d->contenders.testAndSetRelease(1, 0))
                d->wakeUp();
        }
    } else {
#ifndef QT_NO_DEBUG
        d->owner = 0;
#endif
        if (!d->contenders.testAndSetRelease(1, 0)) //////waits in this
line!
            d->wakeUp();
    }
}


The QComboBox which is used to control an image display widget (changes the
image in the display depending on the combo box item selected). See code
below-

connect(ui.comboBox, SIGNAL(activated(int)), this,
SLOT(setComboBoxIndex(int)));

void ImageViewer::setComboBoxIndex(int index)
{
    comboBoxIndex = index;
    populateScene();//function to display image QGrahicsView widget
}

Does anybody know why this is happening?

Thanks,
Caius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100524/3db678b8/attachment.html 


More information about the Qt-interest-old mailing list