QThread on vxWorks
-
Below are the code sample
#include <vxWorks.h>
#include <QThread>
#include <QDebug>class MyThread: public QThread
{
Q_OBJECT
public:
MyThread();
~MyThread();
void Run();
private:};
MyThread::MyThread()
{qDebug()<<"constructor"; start();
}
MyThread::~MyThread()
{
qDebug()<<"destructor";terminate();
}
void MyThread::Run()
{
qDebug()<<"run";
int nBytesReceived = 0;
while(1)
{
//some business logic
}
}The above code is working fine on windows. All debug logs appears
But the same code not working on vxwork with QT.
executing successfully, only getting logs related to constructor, not getting the log of run. Seems Qthread not starting the thread, How to identify and fix the issues on this. -
Below are the code sample
#include <vxWorks.h>
#include <QThread>
#include <QDebug>class MyThread: public QThread
{
Q_OBJECT
public:
MyThread();
~MyThread();
void Run();
private:};
MyThread::MyThread()
{qDebug()<<"constructor"; start();
}
MyThread::~MyThread()
{
qDebug()<<"destructor";terminate();
}
void MyThread::Run()
{
qDebug()<<"run";
int nBytesReceived = 0;
while(1)
{
//some business logic
}
}The above code is working fine on windows. All debug logs appears
But the same code not working on vxwork with QT.
executing successfully, only getting logs related to constructor, not getting the log of run. Seems Qthread not starting the thread, How to identify and fix the issues on this.@Narasimman Why do you call start() in the constructor?
-
Start will execute the Run, We need this as soon object is declared.
-
Start will execute the Run, We need this as soon object is declared.
@Narasimman I know what start() does. I'm not sure it is a good idea to call start() in the constructor while the object is still being constructed.
-
Yes, But is perfectly working on windows. So we used the same code.
-
Any update on this?
-
Any update on this?
Hi @Narasimman, I suspect that very few people on this forum (if any) have access to a vxWorks machine.
Subscribe to the Interest mailing list and post your question there. Qt engineers are active on that list.
-
Even better would be to ask Qt Support. If you use Qt for VxWorks you're a paying customer, after all :)