Clang: Avoid duplicate jobs without changes in-between

This could happen, e.g. with this message order:

  >>> updateTranslationUnitsForEditor()
  add job<1>
  run job<1>
  >>> updateVisibleTranslationUnits(Utf8String(), {})
  >>> updateVisibleTranslationUnits(path, {path})
  add job<2>
  finish job<1>
  run job<2> -- Ops, nothing is changed but job<2> is started

This led to an outdated translation unit (e.g. wrong highlighting).

Now JobQueue checks for duplicates in the queue and checks all the
currently running jobs.

Change-Id: I05843fddcbd21ce0489681c283227c0027ded428
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2016-10-06 12:54:22 +02:00
parent 380d756a03
commit bf5c1cc4fb
9 changed files with 124 additions and 21 deletions

View File

@@ -71,6 +71,8 @@ public:
JobRequest();
bool operator==(const JobRequest &other) const;
public:
quint64 id = 0;
Type type;