Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt::BlockingQueuedConnection blocks worker thread indefinitely if I close application
Forum Update on Monday, May 27th 2025

Qt::BlockingQueuedConnection blocks worker thread indefinitely if I close application

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 5.5k 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.
  • M Offline
    M Offline
    moldovan.catalin
    wrote on last edited by
    #1

    Hi,

    I have an application on N900 that has two threads, the UI thread and a worker thread. In the UI thread I connect a signal from the worker thread with a slot from the UI using Qt::BlockingQueuedConnection (I need this because I cannot create QPixmap in other thread than UI thread) and it works great until I close the application, when sometimes the worker thread doesn't die. I found the problem to be related to this blocking connection, it seems that when the UI dies the semaphore or mutex that is used to block the worker thread is not unlocked in the UI thread and worker thread hangs forever.
    Does anyone have any suggestion how could I prevent this? (Please don't tell me to stop using Qt::BlockingQueuedConnection, that's not an answer).

    Thanks,
    Catalin

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tony
      wrote on last edited by
      #2

      Hi,

      well, I don't know if I've understood your problem clearly, but ...

      can you set a worker thread internal flag that means "it's time to get out", and send a "fake" signal to the worker thread before exiting?

      In this case, the worker thread can test such variable before starting, and, if it's true, it will go out in a clean way.

      Antonio

      1 Reply Last reply
      0

      • Login

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