Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Stop QThread without event loop

Stop QThread without event loop

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 820 Views
  • 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.
  • Q Offline
    Q Offline
    Q139
    wrote on 18 Oct 2016, 19:15 last edited by Q139
    #1

    Are there safer alternatives to terminate(); to stop Qthreads that have no event loops?
    On windows os have not managed to crash but with linux it crashes application always if using terminate();

    Threads are continiualy looped under while loops.
    One way may be to have condition for while loop to end looping but the loop is long and it would be better if instant stop.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 Oct 2016, 19:46 last edited by
      #2

      Hi,

      If you have long loop function break it in smaller logical parts and insert checks for the break condition variable between these logical parts.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2

      1/2

      18 Oct 2016, 19:15

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved