code: public synchronized void markForRebuild(final TargetInfo targetInfo) {
      //
      // if it must already be rebuilt, no need to check further
      //
      if (!targetInfo.getRebuild()) {
        final TargetHistory history = get(targetInfo.getConfiguration().toString(), targetInfo.getOutput().getName());
        if (history == null) {
          targetInfo.mustRebuild();
        } else {
          final SourceHistory[] sourceHistories = history.getSources();
          final File[] sources = targetInfo.getSources();
          if (sourceHistories.length != sources.length) {
            targetInfo.mustRebuild();
          } else {
            final Hashtable<String, File> sourceMap = new Hashtable<>(sources.length);
            for (final File source : sources) {
              try {
                sourceMap.put(source.getCanonicalPath(), source);
              } catch (final IOException ex) {
                sourceMap.put(source.getAbsolutePath(), source);
              }
            }
            for (final SourceHistory sourceHistorie : sourceHistories) {
              //
              // relative file name, must absolutize it on output
              // directory
              //
              final String absPath = sourceHistorie.getAbsolutePath(this.outputDir);
              File match = sourceMap.get(absPath);
              if (match != null) {
                try {
                  match = sourceMap.get(new File(absPath).getCanonicalPath());
                } catch (final IOException ex) {
                  targetInfo.mustRebuild();
                  break;
                }
              }
              if (match == null || match.lastModified() != sourceHistorie.getLastModified()) {
                targetInfo.mustRebuild();
                break;
              }
            }
          }
        }
      }
    }
docs: FREEHEP added synchronized