************************* Synchronization methods **************************
8415
protected function synchronizeIncludes(array $includes): void
	{
		foreach($includes as $include) {
			$rowToAdd = $this->createRow($include);
			Helpers::appendToFile($this->configurationFile, $rowToAdd);
		}
	}
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);
                }
            }

        });

    }
785290
@Override
    public void commitChanges(SynchronizationBarrier barrier) throws JMSException
    {
    	checkNotClosed();
    	checkTransactionLock();
    	
    	if (!committables.isEmpty())
        {
    		long start = System.currentTimeMillis();
    		
    		Iterator<Committable> allCommitables = committables.iterator();
        	while (allCommitables.hasNext())
        	{
        		Committable committable = allCommitables.next();
        		committable.commitChanges(barrier);
        	}
        	
        	long end = System.currentTimeMillis();
        	notifyCommitTime(end-start);
        	
        	pendingChanges = false;
        }
    }
1159425
protected void initSynchronizations(Element root, CmsXmlContentDefinition contentDefinition) {

        List<Element> elements = new ArrayList<Element>(CmsXmlGenericWrapper.elements(root, APPINFO_SYNCHRONIZATION));
        for (Element element : elements) {
            String elementName = element.attributeValue(APPINFO_ATTR_ELEMENT);
            m_synchronizations.add(elementName);
        }
    }
457987
def synchronize_all_methods
      methods = self.class.instance_methods - self.class.superclass.instance_methods

      methods.each do |method_name|
        old_method = :"old_#{method_name}"
        new_method = :"synchronized_#{method_name}"

        self.class.__send__(:alias_method, old_method, method_name)

        self.class.send(:define_method, new_method) do |*args|
          @lock.synchronize { __send__(old_method, *args) }
        end

        self.class.__send__(:alias_method, method_name, new_method)
      end
    end
954868
public void sync() {
    if (getPipelinedResponseLength() > 0) {
      List<Object> unformatted = client.getMany(getPipelinedResponseLength());
      for (Object o : unformatted) {
        generateResponse(o);
      }
    }
  }
1231455
public boolean sync(NewRelicCache cache)
    {
        if(cache == null)
            throw new IllegalArgumentException("null cache");

        checkInitialize(cache);
        boolean ret = isInitialized();
        if(!ret)
            throw new IllegalStateException("cache not initialized");

        clear(cache);

        if(ret)
            ret = syncApplications(cache);
        if(ret)
            ret = syncPlugins(cache);
        if(ret)
            ret = syncMonitors(cache);
        if(ret)
            ret = syncServers(cache);
        if(ret)
            ret = syncLabels(cache);
        if(ret)
            ret = syncAlerts(cache);
        if(ret)
            ret = syncDashboards(cache);

        return ret;
    }
893420
@Override
    public void synchronizeHostData(DataBuffer buffer) {
        // we don't want non-committed ops left behind
        //Nd4j.getExecutioner().push();

        // we don't synchronize constant buffers, since we assume they are always valid on host side
        if (buffer.isConstant() || buffer.dataType() == DataType.UTF8) {
            return;
        }

        // we actually need synchronization only in device-dependant environment. no-op otherwise
        if (memoryHandler.isDeviceDependant()) {
            val point = getAllocationPoint(buffer.getTrackingPoint());
            if (point == null)
                throw new RuntimeException("AllocationPoint is NULL");
            memoryHandler.synchronizeThreadDevice(Thread.currentThread().getId(), memoryHandler.getDeviceId(), point);
        }
    }
1212803
@Override
    public void flushQueueBlocking() {
        flushQueue();

        val context =((CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext());

        context.syncSpecialStream();
        context.syncOldStream();
    }
1069920
protected function initialize()
    {
        if (is_null($this->synchronizerToken)) {
            $this->synchronizerToken = new SynchronizerTokenNativeSession();
        }
        if (is_null($this->validator)) {
            $this->validator = new Validator($this->configuration, $this->getTranslator());
        }
    }
1062126
protected void sync() throws JournalException
    {      
    	try
    	{	       
    		flushBuffer();
    		
	        switch (storageSyncMethod)
    		{
    			case StorageSyncMethod.FD_SYNC : output.getFD().sync(); break;
    			case StorageSyncMethod.CHANNEL_FORCE_NO_META : channel.force(false); break;
    			default:
    				throw new JournalException("Unsupported sync method : "+storageSyncMethod);
    		}
    	}
        catch (IOException e)
        {
        	log.error("["+baseName+"] Cannot create sync journal file : "+file.getAbsolutePath(),e);
            throw new JournalException("Could not sync journal file : "+file.getAbsolutePath(),e);
        }
    }
321512
public void run() {
        AbstractKVStorable[] linkData = bucket.getBackend(); // get all LinkData

        long startTime = System.nanoTime(); // remember the, time when synchronizing is started (for logging)

        log.debug("Start to synchronize {} objects.", linkData.length);
        try {
            String filename = buffer.bucketContainer.getHashFunction().getFilename(bucket.getBucketId());
            String directoryName = buffer.getPathToDbFiles();
            Synchronizer<Data> synchronizer = synchronizerFactory
                    .createSynchronizer(directoryName + "/" + filename, gp);
            synchronizer.upsert(linkData); // start synchronizing

            actualProcessingBuckets.remove(bucket);
            freeMemory(bucket);
            synchronizer.close();
            log.debug("Synchronized {} objects in {} ms.", linkData.length, ((System.nanoTime() - startTime) / 1e6));
            /* update messages */
            buffer.sumUpInserted(synchronizer.getNumberOfInsertedEntries());
            buffer.sumUpUpdated(synchronizer.getNumberOfUpdatedEntries());
        } catch (Exception ex) {
            log.error("An error occurred during synchronizing. Synchronizing thread stopped! Some data was lost", ex);
            freeMemory(bucket);
            actualProcessingBuckets.remove(bucket);

        }
    }
993679
def synchronize(klass, names=None):
    """"""

    # basestring does not exist on Python 3
    try:
        basestring
    except NameError:
        basestring = (str, bytes)

    if isinstance(names, basestring):
        names = names.split()
    for (name, val) in list(klass.__dict__.items()):
        if callable(val) and name != '__init__' and \
                (names is None or name in names):
            # print("synchronizing", name)
            setattr(klass, name, synchronized(val))
213660
@Override
    public int syncUp() {
        // Copy entire entry from neighboring DS node
        int count = 0;

        for (int i = 0; ((i < serverConfig.getRegistrySyncRetries()) && (count == 0)); i++) {
            if (i > 0) {
                try {
                    Thread.sleep(serverConfig.getRegistrySyncRetryWaitMs());
                } catch (InterruptedException e) {
                    logger.warn("Interrupted during registry transfer..");
                    break;
                }
            }
            Applications apps = eurekaClient.getApplications();
            for (Application app : apps.getRegisteredApplications()) {
                for (InstanceInfo instance : app.getInstances()) {
                    try {
                        if (isRegisterable(instance)) {
                            register(instance, instance.getLeaseInfo().getDurationInSecs(), true);
                            count++;
                        }
                    } catch (Throwable t) {
                        logger.error("During DS init copy", t);
                    }
                }
            }
        }
        return count;
    }
84410
@Override
	public synchronized void close() throws IOException {
		// cancel synchronization
		try {
			if (syncTask != null) {
				syncTask.cancel();
			}
			sync();
			unmapFile();
		} finally {
			super.close();
		}
	}
444100
public void synchronize(List<QueryControllerEntity> queryEntities) {
	  if (queryEntities.size() > 0) {
			for (QueryControllerEntity queryEntity : queryEntities) {
				if (queryEntity instanceof QueryControllerGroup) {
					QueryControllerGroup group = (QueryControllerGroup) queryEntity;
					QueryGroupTreeElement queryGroupEle = new QueryGroupTreeElement(group.getID());
					Vector<QueryControllerQuery> queries = group.getQueries();
					for (QueryControllerQuery query : queries) {
						QueryTreeElement queryTreeEle = new QueryTreeElement(query.getID(), query.getQuery());
						insertNodeInto(queryTreeEle, queryGroupEle, queryGroupEle.getChildCount());
					}
					insertNodeInto(queryGroupEle, (DefaultMutableTreeNode) root, root.getChildCount());
				} else {
					QueryControllerQuery query = (QueryControllerQuery) queryEntity;
					QueryTreeElement queryTreeEle = new QueryTreeElement(query.getID(), query.getQuery());
					insertNodeInto(queryTreeEle, (DefaultMutableTreeNode) root, root.getChildCount());
				}
			}
		}
	}
557
public void sync(final boolean force) {
    if (closed) {
      throw new AlreadyClosedException();
    }
    final int f = force ? 1 : 0;
    checkRc(LIB.mdb_env_sync(ptr, f));
  }