[Development] Deprecate the QThread::terminated() signal?

Sze Howe Koh szehowe.koh at gmail.com
Thu Oct 18 17:40:21 CEST 2012

On Mon, Oct 15, 2012 at 11:00 PM, Thiago Macieira <thiago.macieira at intel.com
> wrote:

> On segunda-feira, 15 de outubro de 2012 14.53.39, Olivier Goffart wrote:
> > > Is there any value in keeping a signal that is:
> > > - Only emitted after the program destabilises, and
> > > - Not even guaranteed to be emitted?
> >
> > I even go as far as removing it.
> > Source compatibility is not really broken since you will just get a
> runtime
> > warning saying the signal don't exist.
> Agreed.
> The terminated signal works properly if and only if the thread terminates
> in
> synchronous termination mode and the cleanup handlers are run. If the
> thread
> is killed or terminated asynchronously, or if the handlers aren't run, all
> bets are lost.
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
Ok, I just had a look at the source code to study how to remove the signal.

It looks like the QThread::terminated() signal is only ever emitted from
QThreadPrivate::finish(), if the appropriate flag is set (for both Unix and
Win implementations). That flag is QThreadPrivate::terminated, and it's
only ever queried to decide whether or not to emit the signal.

So, I'm thinking that if QThread::terminated() is removed, then
QThreadPrivate::terminated becomes redundant and can be removed too. Would
you agree?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121018/385de07c/attachment.html>

More information about the Development mailing list