BlockingQueuedConnection is not working it is leading to deadlock condition.
Hi everyone,
I am uing Qt:: BlockingQueuedConnection in the connect option like below, but it going to deadlock state when i use this please help me in this issue soon am a newbie to Qt.. Here is my code
Code:
connect (this, SIGNAL(moduleDatarcvd(int)), this, SLOT(ShowModuleSimWnd(int)),Qt::BlockingQueuedConnection);
here i am waiting for a signal to come when my ShowmoduleSimWnd method is called. please tell me an alternative that wath i can use.and for this blocking of my ui is happening. please help me
Re: BlockingQueuedConnection is not working it is leading to deadlock condition.
Don't ask the same question in two places... it is bad manners and only serves to fracture any response.
Re: BlockingQueuedConnection is not working it is leading to deadlock condition.
Sorry i am new to this forum..
Re: BlockingQueuedConnection is not working it is leading to deadlock condition.
rtfm ;)
Quote:
Qt::BlockingQueuedConnection - Same as QueuedConnection, except the current thread blocks until the slot returns. This connection type should only be used where the emitter and receiver are in different threads. Note: Violating this rule can cause your application to deadlock.
http://doc.qt.nokia.com/4.7-snapshot...ctionType-enum
Re: BlockingQueuedConnection is not working it is leading to deadlock condition.
Code:
void VSDPM_CDT::DisplaySimWnd(int nModule)
{
emit moduleDatarcvd(nModule);
}
Here i am emitting a signal i.e n module and at receiver side:
Code:
connect (this, SIGNAL(moduleDatarcvd(int)), this, SLOT(ShowModuleSimWnd(int)),Qt::BlockingQueuedConnection);
and my ShowmoduleSimWnd is a method which will be called when it is received a signal i.e
Code:
void VSDPM_CDT::ShowModuleSimWnd(int nModule)
{
if(nModule == 0)
{
OnClickCanSimulation();
}
else if(nModule == 1)
{
OnClickLinSimulation();
}
else if(nModule == 2)
{
OnClickADCSimulation();
}
else if(nModule == 3)
{
OnClickDIOSimulation();
}
else if(nModule == 4)
{
OnClickPWMSimulation();
}
else if(nModule == 5)
{
ShowLogMessage("test","Inside module");
OnClickTCPIPSimulation();
}
else if(nModule == 6)
{
OnClickBTSimulation();
}
}
in lin if(nModule == 5) i am getting a problem. Actually i am blocking the queue here to wait for a signal to come. please help me in this scenario
Re: BlockingQueuedConnection is not working it is leading to deadlock condition.
You have not given enough information. May I direct you to my signature.