If you know that either thread is going to modify the data, why not create a deep copy in the first place?
void mainFunction () {
QVector<int> value = ...;
valueForThread = value; // create a copy for thread
valueForThread.detatch(); // create deep copy
startThread(&threadFunction);
value = ...; // doesn't affect thread
}
void mainFunction () {
QVector<int> value = ...;
valueForThread = value; // create a copy for thread
valueForThread.detatch(); // create deep copy
startThread(&threadFunction);
value = ...; // doesn't affect thread
}
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks