Review Request: Do not terminate threads

Albert Astals Cid tsdgeos at terra.es
Thu Aug 11 12:24:22 BST 2011



> On Aug. 11, 2011, 11:11 a.m., Thiago Macieira wrote:
> > kio/kio/hostinfo.cpp, line 118
> > <http://git.reviewboard.kde.org/r/102179/diff/7/?file=31685#file31685line118>
> >
> >     This class could be simplified to a simple struct.

Yeah, but what's the benefit?


> On Aug. 11, 2011, 11:11 a.m., Thiago Macieira wrote:
> > kio/kio/hostinfo.cpp, line 264
> > <http://git.reviewboard.kde.org/r/102179/diff/7/?file=31685#file31685line264>
> >
> >     Remove the cache too. QHostInfo already caches.

As explained in the other request our cache has more "features" than yours, so can't do it.


> On Aug. 11, 2011, 11:11 a.m., Thiago Macieira wrote:
> > kio/kio/hostinfo.cpp, line 272
> > <http://git.reviewboard.kde.org/r/102179/diff/7/?file=31685#file31685line272>
> >
> >     Huh? What is the acquire/release doing here?

Making sure the worker has been created and the thread is ready to get petitions the way David asked me to do it.


> On Aug. 11, 2011, 11:11 a.m., Thiago Macieira wrote:
> > kio/kio/hostinfo.cpp, line 201
> > <http://git.reviewboard.kde.org/r/102179/diff/7/?file=31685#file31685line201>
> >
> >     This class isn't necessary. We can do the same with QThread alone.
> >     
> >     To quit the thread, connect the worker's destroyed() signal to the thread's quit() slot. Then just deleteLater the worker.

Can you explain how do i create the worker in the qthread or move it to the thread without having my own class? Don't see how to do it.


- Albert


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102179/#review5636
-----------------------------------------------------------


On Aug. 11, 2011, 10:34 a.m., Albert Astals Cid wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102179/
> -----------------------------------------------------------
> 
> (Updated Aug. 11, 2011, 10:34 a.m.)
> 
> 
> Review request for kdelibs and Dawit Alemayehu.
> 
> 
> Summary
> -------
> 
> Each time the terminate code triggers my Konqueror crashes, i'm substituting the terminate for just waiting the thread to finish and we just ignoring it.
> 
> The code has a race condition in which wait() returns false, then we switch to the thread and m_autoDelete is still not set and thus noone will delete the thread. I can add a mutex if you guys think this is unacceptable.
> 
> 
> Diffs
> -----
> 
>   kio/kio/hostinfo.cpp 344b1d8 
> 
> Diff: http://git.reviewboard.kde.org/r/102179/diff
> 
> 
> Testing
> -------
> 
> When the 
> kDebug() << "Name look up for" << hostName << "failed";
> if triggers i do not get a crash anymore.
> 
> 
> Thanks,
> 
> Albert
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110811/1ba3e4e1/attachment.htm>


More information about the kde-core-devel mailing list