FREEHEP added synchronized
181515
private synchronized void update(final String configId, final String outputName, final String[] sources) {
    final File outputFile = new File(this.outputDir, outputName);
    //
    // if output file doesn't exist or predates the start of the
    // compile step (most likely a compilation error) then
    // do not write add a history entry
    //
    if (outputFile.exists() && !CUtil.isSignificantlyBefore(outputFile.lastModified(), this.historyFile.lastModified())) {
      this.dirty = true;
      this.history.remove(outputName);
      final SourceHistory[] sourceHistories = new SourceHistory[sources.length];
      for (int i = 0; i < sources.length; i++) {
        final File sourceFile = new File(sources[i]);
        final long lastModified = sourceFile.lastModified();
        final String relativePath = CUtil.getRelativePath(this.outputDirPath, sourceFile);
        sourceHistories[i] = new SourceHistory(relativePath, lastModified);
      }
      final TargetHistory newHistory = new TargetHistory(configId, outputName, outputFile.lastModified(),
          sourceHistories);
      this.history.put(outputName, newHistory);
    }
  }
1165039
private void sync(ImmutableMember member) {
    LOGGER.trace("{} - Synchronizing membership with {}", localMember.id(), member);
    bootstrapService.getMessagingService().sendAndReceive(
        member.address(), MEMBERSHIP_SYNC, SERIALIZER.encode(localMember.copy()), false, config.getProbeTimeout())
        .whenCompleteAsync((response, error) -> {
          if (error == null) {
            Collection<ImmutableMember> members = SERIALIZER.decode(response);
            members.forEach(this::updateState);
          } else {
            LOGGER.debug("{} - Failed to synchronize membership with {}", localMember.id(), member);
          }
        }, swimScheduler);
  }
236343
public synchronized boolean sync() {
		if (!validState) {
			throw new InvalidStateException();
		}
		try {
			flushBuffer();
			if (!syncOnFlush) {
				fcOutput.force(false);
				if (callback != null) {
					callback.synched(offsetOutputCommited);
				}
			}
			return true;
		} catch (Exception e) {
			log.error("Exception in sync()", e);
		}
		return false;
	}
536272
def sync(to_install, to_uninstall, verbose=False, dry_run=False, install_flags=None):
    
    if not to_uninstall and not to_install:
        click.echo("Everything up-to-date")

    pip_flags = []
    if not verbose:
        pip_flags += ['-q']

    if to_uninstall:
        if dry_run:
            click.echo("Would uninstall:")
            for pkg in to_uninstall:
                click.echo("  {}".format(pkg))
        else:
            check_call([sys.executable, '-m', 'pip', 'uninstall', '-y'] + pip_flags + sorted(to_uninstall))

    if to_install:
        if install_flags is None:
            install_flags = []
        if dry_run:
            click.echo("Would install:")
            for ireq in to_install:
                click.echo("  {}".format(format_requirement(ireq)))
        else:
            # prepare requirement lines
            req_lines = []
            for ireq in sorted(to_install, key=key_from_ireq):
                ireq_hashes = get_hashes_from_ireq(ireq)
                req_lines.append(format_requirement(ireq, hashes=ireq_hashes))

            # save requirement lines to a temporary file
            tmp_req_file = tempfile.NamedTemporaryFile(mode='wt', delete=False)
            tmp_req_file.write('\n'.join(req_lines))
            tmp_req_file.close()

            try:
                check_call(
                    [sys.executable, '-m', 'pip', 'install', '-r', tmp_req_file.name] + pip_flags + install_flags
                )
            finally:
                os.unlink(tmp_req_file.name)

    return 0
291902
def sync(self):
        ''
        log.info("syncing %r" % self.path)
        self.folder = self.jfs.get(self.path)
        self.synced = True
1006859
public void sync(final String path, VoidCallback cb, Object ctx) {
        verbotenThreadCheck();
        final String clientPath = path;
        PathUtils.validatePath(clientPath);

        final String serverPath = prependChroot(clientPath);

        RequestHeader h = new RequestHeader();
        h.setType(ZooDefs.OpCode.sync);
        SyncRequest request = new SyncRequest();
        SyncResponse response = new SyncResponse();
        request.setPath(serverPath);
        cnxn.queuePacket(h, new ReplyHeader(), request, response, cb,
                clientPath, serverPath, ctx, null);
    }
46517
public function syncManifest()
    {
        $this->validateName();

        if ($this->manifest) {
            $headers = $this->getNewHeaders();
            $headers['Content-Length'] = '0';

            $this->container->getConnection()->makeRequest(
                Client::PUT,
                array($this->container->getName(), $this->name),
                $headers
            );
        }
    }
683219
@Override
    public void onKnownIssueAlreadySynchronized(final AcraReport pReport, final Issue pIssue)
            throws SynchronizationException {

        pReport.setStatus(SyncStatus.SUCCESS);
    }
1138056
def sync(self):
        ''''''
        if self.flag == 'r':
            return
        filename = self.filename
        tempname = filename + '.tmp'
        fileobj = open(tempname, 'wb' if self.file_format == 'pickle' else 'w')
        try:
            self.dump(fileobj)
        except Exception:
            os.remove(tempname)
            raise
        finally:
            fileobj.close()
        shutil.move(tempname, self.filename)    # atomic commit
        if self.mode is not None:
            os.chmod(self.filename, self.mode)
786120
void free() {
        if (c4enum != null) {
            synchronized (getDatabase().getLock()) {
                c4enum.close();
            }
            c4enum.free();
            c4enum = null;
        }
    }
1300176
@Override
  public void startSync(AlluxioURI ufsUri) {
    LOG.debug("Add {} as a sync point", ufsUri.toString());
    mUfsUriList.add(ufsUri);
  }
356757
def sync(self):
        
        phase = _get_phase(self._formula_instance)
        self.logger.info("%s %s..." % (phase.verb.capitalize(), self.feature_name))
        message = "...finished %s %s." % (phase.verb, self.feature_name)
        result = getattr(self, phase.name)()
        if result or phase in (PHASE.INSTALL, PHASE.REMOVE):
            self.logger.info(message)
        else:
            self.logger.debug(message)
        return result
938126
def flush_synced(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.flush_synced(index=self._name, **kwargs)
1072730
function SyncParser(importer) {
    Parser.call(this, importer);

    importer.registerEventHandler(
        'sync_timeline',
        SyncParser.prototype.timelineEvent.bind(this));
    importer.registerEventHandler(
        'sync_wait',
        SyncParser.prototype.syncWaitEvent.bind(this));
    importer.registerEventHandler(
        'sync_pt',
        SyncParser.prototype.syncPtEvent.bind(this));
    this.model_ = importer.model_;
  }
803676
private final void freeByteArrayStream(ByteArrayOutputStream baos)
    {
        // If the pool is not full, then add to the pool. Note that this must
        // be synchronized, as multiple threads may access the pool.       d175235
        synchronized (svBAOSs)
        {
            if (svBAOSsSize < svBAOSs.length)
            {
                svBAOSs[svBAOSsSize] = baos;
                ++svBAOSsSize;
            }
        }
    }
211942
private void synchronizeHosts(final AsyncCallback<Boolean> callback) {
        ModelNode op = new ModelNode();
        op.get(ADDRESS).setEmptyList();
        op.get(OP).set(READ_CHILDREN_RESOURCES_OPERATION);
        op.get(CHILD_TYPE).set("host");

        Footer.PROGRESS_ELEMENT.reset();

        dispatcher.execute(new DMRAction(op), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(Throwable caught) {
                Footer.PROGRESS_ELEMENT.finish();
                callback.onFailure(caught);
            }

            @Override
            public void onSuccess(DMRResponse result) {
                ModelNode response = result.get();
                if (response.isFailure()) {
                    Footer.PROGRESS_ELEMENT.finish();
                    callback.onFailure(new RuntimeException("Failed to synchronize host model: " + response.getFailureDescription()));
                } else {
                    List<Property> properties = response.get(RESULT).asPropertyList();
                    List<String> hostNames = new ArrayList<String>(properties.size());
                    for (Property property : properties) {
                        hostNames.add(property.getName());
                        if (property.getValue().hasDefined("master") && property.getValue().get("master").asBoolean()) {
                            domainController = property.getName();
                        }
                    }

                    Footer.PROGRESS_ELEMENT.finish();

                    // synchronize servers
                    synchronizeServerModel(hostNames, callback);
                }
            }

        });

    }
648669
private void addShutdownHook() {
    if (!running) {
      destroyProcessThread = new ProcessDestroyerImpl();
      Runtime.getRuntime().addShutdownHook(destroyProcessThread);
      added = true;
    }
  }