Lock the given content

 @param content [Hash] content to lock
 @return [Hash] locked content
546153
def lock_content(content)
      content = content.to_smash
      content.merge!(:sfn_lock_enabled => true)
      safe = SfnParameters::Safe.build(
        config.fetch(:sfn_parameters, :safe, Smash.new)
      )
      safe.lock(dump_json(content))
    end
1128193
private static void lockBoth(Lock sourceWriteLock, Lock destWriteLock) {
    while (true) {
      sourceWriteLock.lock();
      if (destWriteLock.tryLock()) {
        return;
      } else {
        sourceWriteLock.unlock();
      }

      destWriteLock.lock();
      if (sourceWriteLock.tryLock()) {
        return;
      } else {
        destWriteLock.unlock();
      }
    }
  }
953666
def set(self, uri, content):
        
        key, value = self._prepare_node(uri, content)
        self._set(key, value)
878800
def lock(instance_id, profile=None, **kwargs):
    '''
    

    '''
    conn = _auth(profile, **kwargs)
    return conn.lock(instance_id)
882625
def _get_sha256_digest(self, content):
        
        content_sha256 = base64.b64encode(SHA256.new(content).digest())
        return 'SHA256=' + content_sha256
439785
def write(content)
      handle = File.open(@path, 'w')

      handle.write(content)
      handle.close
    end
148459
public function setContent($content)
    {
        if (!is_null($content)) {
            $content = (string) $content;
        }

        $this->content = $content;
        return $this;
    }
311676
def _lock(self, url: str, name: str, hash_: str):
        
        self._new_lock.append({
            'url': url,
            'name': name,
            'hash': hash_,
        })
        self._stale_files.pop(name, None)
42727
public function setContent($content)
    {
        $this->content = null;
        if ($content === null) {
            return;
        }

        if (TypeHandling::isSimpleType(gettype($content)) && !is_array($content)) {
            $this->content = (string)$content;
        }

        if (is_resource($content)) {
            $this->content = $content;
        }

        return $this;
    }
681734
def broadcast(content)
      message = {
        id: SecureRandom.uuid,
        content: content
      }

      send_message('MSG_BROADCAST', message)
    end
358867
def lock
      cmd = Xcode::Shell::Command.new "security"
      cmd << "lock-keychain"
      cmd << "\"#{@path}\""
      cmd.execute
    end
572789
def try_lock
      locked = false
      Thread.exclusive do
        clean
        unless(locked?(false))
          do_lock
          locked = true
        else
          locked = owner?(Thread.current)
        end
      end
      locked
    end
1043383
public function setContent($content)
    {
        $this->contents = trim($content);

        $this->parsedContents = null;
        return $this;
    }
833328
def lock(self, remote=None):
        '''
        
        '''
        locked = []
        errors = []
        for repo in self.remotes:
            if remote:
                # Specific remote URL/pattern was passed, ensure that the URL
                # matches or else skip this one
                try:
                    if not fnmatch.fnmatch(repo.url, remote):
                        continue
                except TypeError:
                    # remote was non-string, try again
                    if not fnmatch.fnmatch(repo.url, six.text_type(remote)):
                        continue
            success, failed = repo.lock()
            locked.extend(success)
            errors.extend(failed)
        return locked, errors
31870
def lock_machine(uuid)
      lock_path = @data_dir.join("#{uuid}.lock")
      lock_file = lock_path.open("w+")
      if lock_file.flock(File::LOCK_EX | File::LOCK_NB) === false
        lock_file.close
        lock_file = nil
      end

      lock_file
    end
204171
public final Lock lock(Object key) {
        Lock lock = this.locks.get(key);
        lock.lock();
        return lock;
    }
1269739
function(content) {
		
		// clone if asked. Cloning the object makes sure that each instance has its
		// own version of the content (in case a same object were provided for several
		// instances)
		// reminder: typeof null === object
		if (content instanceof $ && this.__options.contentCloning) {
			content = content.clone(true);
		}
		
		this.__Content = content;
		
		this._trigger({
			type: 'updated',
			content: content
		});
		
		return this;
	}