Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-23961

adopted thread watcher can't clean up its own thread data

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.8.2
    • 5.0.0
    • Core: Threads
    • None
    • windows 7 x64 sp1
      vs2010 sp1
    • 91cf813c816582188ef8943b29338c3db06d1133 (4.8)

    Description

      adopted thread watcher is responsible for clean up thread data of all other adopted thread, but it can not clean up the thread data of its own.
      qt_adopted_thread_watcher_function() will call the following functions to finish an exited adopted thread:
      thread_p->finish(thread); --> QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); --> QThreadData *data = QThreadData::current();
      As a result of this, adopted thread wather will create its own thread data and its own QAdoptedThread object in QThreadData::current(); and add it to the watch list. Thus the adopted thread watcher thread can't exit because the only exit condition is "qt_adopted_thread_handles.count() == 1" which will never meet. Thus the adopted thread wather's thread data can't be cleaned up and the watcher thread also can't exit.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            jianliang79 liang jian
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes