Threadsafe project model

David Nolden zwabel at googlemail.com
Fri Jul 16 12:03:03 UTC 2010


Argh sorry, accidentally hit "Send". So let's continue:

parseTarget() {
collect data;
QString targetName = someName;
QString absoluteTargetPath = somePath;

DO_IN_FOREGROUND_2( targetName, absoluteTargetPath,
   Arbitrary code that will be executed in the foreground;
   May consist of as many lines as wanted;
   QString& targetName and QString& absouteTargetPath variables are
visible, they reference the objects from the waiting background
thread;
   Any signals emitted here will be delivered right away within the foreground;
   Execution in the background thread will continue after the
processing in the foreground has finished;
)
}

The X in DO_IN_FOREGROUND_X indicates the number of references that
are to be passed into the following code-block (aka. the first 2
arguments).

Greetings, David




More information about the KDevelop-devel mailing list