Review Request: Quit Eventloop before emitting finished and result signals

Sebastian Sauer sebsauer at kdab.com
Thu Nov 12 12:02:48 GMT 2009



> On 2009-11-11 23:28:56, Andreas Pakulat wrote:
> > I might be missing something, but why would one call KJob::exec() twice on the same job? I thought thats already an error to do, much like you don't run the same qthread instance twice.

Well, the call exec() twice is the simplest example I came up with. The more concrete case is within the Akonadi port of KOrganizer. There KOrganizer was freezing and me was the only one who was able to reproduce it it seems. Long story short result; such a random behaviour results usually in a developer who does not note the mistake and later cannot reproduce the problem while a certain users (usually me, heh) keeps on to run into it.


- Sebastian


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


On 2009-11-11 22:06:41, Sebastian Sauer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/2140/
> -----------------------------------------------------------
> 
> (Updated 2009-11-11 22:06:41)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> If KJob::exec is called then it can happen that the result(KJob*) signal is emitted before the QEventLoop in KJob::exec is quit. If a slot connected with the result(KJob*) signal does then e.g. call the same KJob::exec again then funny things may happen. The patch introduces a new internal signal that is called before the finished and result signals are emitted and that quits the eventloop. This way we can be sure that the finished and result signals are always emitted once the eventloop is done.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdelibs/kdecore/jobs/kjob.h 1047234 
>   /trunk/KDE/kdelibs/kdecore/jobs/kjob.cpp 1047234 
> 
> Diff: http://reviewboard.kde.org/r/2140/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sebastian
> 
>





More information about the kde-core-devel mailing list