Public: Ensure that adapter is in sync with source adapter provided.

 Returns result of Synchronizer#call.
764477
def import(source_adapter)
      Adapters::Sync::Synchronizer.new(self, source_adapter, raise: true).call
    end
962580
async def start(self):
        

        successful = 0

        try:
            for adapter in self.adapters:
                await adapter.start()
                successful += 1

            self._started = True
        except:
            for adapter in self.adapters[:successful]:
                await adapter.stop()

            raise
697450
def build
      adapter = @proxies.first
      if Array === adapter
        klass, options, block = adapter
        adapter = new_proxy(klass, options, &block)
        check_arity(klass, adapter, 1)
      end
      @proxies[1..-1].inject([adapter]) do |result, proxy|
        klass, options, block = proxy
        proxy = new_proxy(klass, result.last, options, &block)
        check_arity(klass, proxy, 2)
        result << proxy
      end
    end
164434
synchronized void sync()
    {
        try
        {
            // check we have more work to do
            if (allocatePosition.get() <= lastSyncedOffset + SYNC_MARKER_SIZE)
                return;

            // allocate a new sync marker; this is both necessary in itself, but also serves to demarcate
            // the point at which we can safely consider records to have been completely written to
            int nextMarker;
            nextMarker = allocate(SYNC_MARKER_SIZE);
            boolean close = false;
            if (nextMarker < 0)
            {
                // ensure no more of this CLS is writeable, and mark ourselves for closing
                discardUnusedTail();
                close = true;

                // wait for modifications guards both discardedTailFrom, and any outstanding appends
                waitForModifications();

                if (discardedTailFrom < buffer.capacity() - SYNC_MARKER_SIZE)
                {
                    // if there's room in the discard section to write an empty header, use that as the nextMarker
                    nextMarker = discardedTailFrom;
                }
                else
                {
                    // not enough space left in the buffer, so mark the next sync marker as the EOF position
                    nextMarker = buffer.capacity();
                }
            }
            else
            {
                waitForModifications();
            }

            assert nextMarker > lastSyncedOffset;

            // write previous sync marker to point to next sync marker
            // we don't chain the crcs here to ensure this method is idempotent if it fails
            int offset = lastSyncedOffset;
            final PureJavaCrc32 crc = new PureJavaCrc32();
            crc.updateInt((int) (id & 0xFFFFFFFFL));
            crc.updateInt((int) (id >>> 32));
            crc.updateInt(offset);
            buffer.putInt(offset, nextMarker);
            buffer.putInt(offset + 4, crc.getCrc());

            // zero out the next sync marker so replayer can cleanly exit
            if (nextMarker < buffer.capacity())
            {
                buffer.putInt(nextMarker, 0);
                buffer.putInt(nextMarker + 4, 0);
            }

            // actually perform the sync and signal those waiting for it
            buffer.force();

            if (close)
                nextMarker = buffer.capacity();

            lastSyncedOffset = nextMarker;
            syncComplete.signalAll();

            CLibrary.trySkipCache(fd, offset, nextMarker);
            if (close)
                internalClose();
        }
        catch (Exception e) // MappedByteBuffer.force() does not declare IOException but can actually throw it
        {
            throw new FSWriteError(e, getPath());
        }
    }
1208753
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # HMC operation is synchronous
        adapter_uri = uri.split('/operations/')[0]
        try:
            adapter = hmc.lookup_by_uri(adapter_uri)
        except KeyError:
            raise InvalidResourceError(method, uri)
        cpc = adapter.manager.parent
        assert cpc.dpm_enabled
        check_required_fields(method, uri, body, ['type'])

        new_adapter_type = body['type']

        # Check the validity of the adapter family
        adapter_family = adapter.properties.get('adapter-family', None)
        if adapter_family != 'ficon':
            raise BadRequestError(
                method, uri, reason=18,
                message="The adapter type cannot be changed for adapter "
                        "family: %s" % adapter_family)

        # Check the adapter status
        adapter_status = adapter.properties.get('status', None)
        if adapter_status == 'exceptions':
            raise BadRequestError(
                method, uri, reason=18,
                message="The adapter type cannot be changed for adapter "
                        "status: %s" % adapter_status)

        # Check the validity of the new adapter type
        if new_adapter_type not in ['fc', 'fcp', 'not-configured']:
            raise BadRequestError(
                method, uri, reason=8,
                message="Invalid new value for 'type' field: %s" %
                        new_adapter_type)

        # Check that the new adapter type is not already set
        adapter_type = adapter.properties.get('type', None)
        if new_adapter_type == adapter_type:
            raise BadRequestError(
                method, uri, reason=8,
                message="New value for 'type' field is already set: %s" %
                        new_adapter_type)

        # TODO: Reject if adapter is attached to a partition.

        # Reflect the result of changing the adapter type
        adapter.properties['type'] = new_adapter_type
1203439
@Override
    public void synchronizeThreadDevice(Long threadId, Integer deviceId, AllocationPoint point) {
        // we synchronize only if this AllocationPoint was used within device context, so for multiple consequent syncs only first one will be issued
        flowController.synchronizeToHost(point);
    }
346438
def sync_getch
      return self.getch unless sync_enabled?

      c = -1
      while c == -1 && !shutdown?
        c = self.getch
        run_sync!
      end

      c
    end
1182456
def merge source
      result = nil
      mutex.synchronize do
        result = workspace.merge(source)
        @synchronized = !result if synchronized?
      end
      result
    end
1241604
def synchronizeResponse(self, pid, vendorSpecific=None):
        
        mmp_dict = {'pid': pid}
        return self.POST(['synchronize'], fields=mmp_dict, headers=vendorSpecific)
1093784
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return SyncMapItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            map_sid=self._solution['map_sid'],
            key=self._solution['key'],
        )
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
485731
def signal
      synchronize do
        while(t = @threads.shift)
          if(t && t.alive? && t.stop?)
            t.wakeup
            break
          else
            next
          end
        end
      end
    end
769709
def synchronizer(self):
        
        if not self.synchronizer_path or self.synchronizer_path == 'None' or not self.layer:
            return False
        # ensure data is up to date
        if (self._synchronizer is not None and self._synchronizer_class.__name__ not in self.synchronizer_path):
            self._synchronizer = None
            self._synchronizer_class = None
        # init synchronizer only if necessary
        if not self._synchronizer:
            self._synchronizer = (self.synchronizer_class)(self.layer)
        return self._synchronizer
497125
def sync(filename, connection=None):
    
    c = connection or connect()
    rev = c.ls(filename)
    if rev:
        rev[0].sync()
876411
def sync_with(name, syncer_id = nil, &block)
      @syncers << get_class_from_scope(Syncer, name).new(syncer_id, &block)
    end
367581
def sync_list_items(self):
        
        if self._sync_list_items is None:
            self._sync_list_items = SyncListItemList(
                self._version,
                service_sid=self._solution['service_sid'],
                list_sid=self._solution['sid'],
            )
        return self._sync_list_items
109720
def validate
      target_proxies = @proxies.dup
      target_proxies_lock = Mutex.new
      connectable_proxies = []
      connectable_proxies_lock = Mutex.new
      threads = []

      ProxyFetcher.config.pool_size.times do
        threads << Thread.new do
          loop do
            proxy = target_proxies_lock.synchronize { target_proxies.shift }
            break unless proxy

            connectable_proxies_lock.synchronize { connectable_proxies << proxy } if proxy.connectable?
          end
        end
      end

      threads.each(&:join)

      @valid_proxies = connectable_proxies
    end