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
QtWS25 Last Chance

Stop QThread without event loop

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 817 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 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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

      • Login

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