Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved QThread on vxWorks

    Mobile and Embedded
    4
    8
    716
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Narasimman last edited by

      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.

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @Narasimman last edited by

        @Narasimman Why do you call start() in the constructor?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 2
        • N
          Narasimman last edited by

          Start will execute the Run, We need this as soon object is declared.

          jsulm 1 Reply Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @Narasimman last edited by

            @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.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 1
            • N
              Narasimman last edited by

              Yes, But is perfectly working on windows. So we used the same code.

              1 Reply Last reply Reply Quote 0
              • N
                Narasimman last edited by

                Any update on this?

                JKSH 1 Reply Last reply Reply Quote 0
                • JKSH
                  JKSH Moderators @Narasimman last edited by

                  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.

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  1 Reply Last reply Reply Quote 2
                  • kkoehne
                    kkoehne Moderators last edited by

                    Even better would be to ask Qt Support. If you use Qt for VxWorks you're a paying customer, after all :)

                    Director R&D, The Qt Company

                    1 Reply Last reply Reply Quote 3
                    • First post
                      Last post