[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdecore/jobs
From:       Thomas McGuire <mcguire () kde ! org>
Date:       2010-01-16 18:47:14
Message-ID: 1263667634.927161.11812.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1075779 by tmcguire:

Add big warning about exec()


 M  +13 -0     kjob.h  


--- trunk/KDE/kdelibs/kdecore/jobs/kjob.h #1075778:1075779
@@ -226,6 +226,19 @@
     /**
      * Executes the job synchronously.
      *
+     * This will start a nested QEventLoop internally. Nested event loop can be dangerous and
+     * can have unintended side effects, you should avoid calling exec() whenever you can and use the 
+     * asyncronous interface of KJob instead.
+     *
+     * Should you indeed call this method, you need to make sure that all callers are reentrant,
+     * so that events delivered by the inner event loop don't cause non-reentrant functions to be
+     * called, which usually wreaks havoc.
+     *
+     * Note that the event loop started by this method does not process user input events, which means
+     * your user interface will effectivly be blocked. Other events like paint or network events are 
+     * still being processed. The advantage of not processing user input events is that the chance of
+     * accidental reentrancy is greatly reduced. Still you should avoid calling this function.
+     *
      * @return true if the job has been executed without error, false otherwise
      */
     bool exec();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic