28.09.2013 13:57, Alexander Syvak пишет:
Each thread emits blocking queued singnals to the main thread where button stop executes the code in the previous mail.


2013/9/28 Mandeep Sandhu <mandeepsandhu....@gmail.com <mailto:mandeepsandhu....@gmail.com>>


    On Sat, Sep 28, 2013 at 3:14 PM, Alexander Syvak
    <alexander....@gmail.com <mailto:alexander....@gmail.com>> wrote:

        Hello,

        how to correctly stop a QThread execution?

        I am using
        thread.quit();

        thread.terminate();


    Don't terminate. Quitting and waiting should be sufficient.

        thread.wait(500);


        Without terminate() thread wait forever. Each thread is executing an 
event loop only (object is moved into thread).


    Is there anything else the thread could be stuck on? Busy looping
    somewhere? Waiting for a syscall?

    HTH,
    -mandeep



        _______________________________________________
        Interest mailing list
        Interest@qt-project.org <mailto:Interest@qt-project.org>
        http://lists.qt-project.org/mailman/listinfo/interest




There is an answer. Don't block the thread by blocking signal and thread will be stopped successfully by calling quit(). quit() uses thead's event loop.


_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
.
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to