Enables write through operation and sets a writer customization that gets
called synchronously upon cache mutations. By default write through is not enabled.
772066
public final Cache2kBuilder<K, V> writer(CacheWriter<K, V> w) {
    config().setWriter(wrapCustomizationInstance(w));
    return this;
  }
536501
@Override
    public void write(final Writer writer) throws ConfigurationException, IOException {
        Preconditions.checkNotNull(writer);

        @SuppressWarnings("unchecked") final
        HashMap<String, Object> settings = (HashMap<String, Object>) fromNode(this.getModel().getInMemoryRepresentation());
        this.mapper.writerWithDefaultPrettyPrinter().writeValue(writer, settings);
    }
628607
void prepareForWrite(long xaDataRecorderId) throws IOException, InterruptedException {
      this.dataLogger.reopen(AccessMode.WRITE);
      this.writeStartSequence(xaDataRecorderId);
   }
876302
public void setCustomFontEnabled(final boolean ENABLED) {
        if (null == customFontEnabled) {
            _customFontEnabled = ENABLED;
            fireUpdateEvent(RESIZE_EVENT);
        } else {
            customFontEnabled.set(ENABLED);
        }
    }
570046
@Override
    public void addWriteInterest(){
        if(transportOut.peekOut==this)
            transportOut.peekOutInterested = true;
        if(engine.isOutboundDone())
            transportOut.wakeupWriter();
        else{
            if(selfInterests==0)
                peerOut.addWriteInterest();
            else{
                if((selfInterests&OP_READ)!=0)
                    peerIn.addReadInterest();
                if((selfInterests&OP_WRITE)!=0)
                    peerOut.addWriteInterest();
            }
        }
    }
772638
public void setWriter(Object sysLogHolder, Object sysErrHolder) {
        this.sysOutHolder = (SystemLogHolder) sysLogHolder;
        this.sysErrHolder = (SystemLogHolder) sysErrHolder;
    }
227866
private function onWritable()
    {
        $bytesWritten = @\fwrite($this->socket, $this->writeBuffer);

        if ($bytesWritten === false) {
            $this->close();
            return;
        }

        if ($bytesWritten === 0) {
            return;
        }

        $this->timeoutCache->renew($this->id);

        if ($bytesWritten !== \strlen($this->writeBuffer)) {
            $this->writeBuffer = \substr($this->writeBuffer, $bytesWritten);
            return;
        }

        $this->writeBuffer = "";

        Loop::disable($this->writeWatcher);
        $deferred = $this->writeDeferred;
        $this->writeDeferred = null;
        $deferred->resolve();
    }
1053184
public void startWrite() {
		SynchronizationPoint<NoException> sp;
		synchronized (this) {
			// if nobody is using the resource, we can start writing
			if (readers == 0 && !writer) {
				writer = true;
				return;
			}
			// someone is doing something, we need to block
			sp = new SynchronizationPoint<NoException>();
			if (writersWaiting == null) writersWaiting = new LinkedList<>();
			writersWaiting.add(sp);
		}
		sp.block(0);
	}
1347483
private void completeWrite(Write write) {
        Timer t = write.complete();
        if (t != null) {
            this.metrics.bookKeeperWriteCompleted(write.data.getLength(), t.getElapsed());
        }
    }
180632
private boolean writeLockAvailable(int type) {
        if (mReadLocks == 0 && mWriteLockHeld == null) {
            return (type == UPGRADABLE) ? true : mUpgradableLockHeld == null;
        }
        return false;
    }
110751
def acquire_write_lock
      while(true)
        c = @counter.value
        raise ResourceLimitError, 'Too many writer threads' if max_writers?(c)

        if c == 0
          break if @counter.compare_and_swap(0,RUNNING_WRITER)
        elsif @counter.compare_and_swap(c,c+WAITING_WRITER)
          while(true)
            @writer_mutex.synchronize do
              c = @counter.value
              if running_writer?(c) || running_readers?(c)
                @writer_q.wait(@writer_mutex)
              end
            end

            c = @counter.value
            break if !running_writer?(c) && !running_readers?(c) &&
              @counter.compare_and_swap(c,c+RUNNING_WRITER-WAITING_WRITER)
          end
          break
        end
      end
      true
    end
808135
private void lockWritersExclusive() {

        if (exclusiveLockOwner == Thread.currentThread()) {
            writers.decrementAndGet();
            return;
        }

        synchronized (this) {
            for (;;) {

                if (writers.compareAndSet(0, -1)) {
                    exclusiveLockOwner = Thread.currentThread();
                    return;
                }
            }
        }
    }
1144598
public Writer writeTo(final Writer out) throws IOException {
        if (this.out!=null) {
            // StackOverflow prevention
            return NullWriter.DEFAULT;
        }
        try {
            this.out = createWriter(out);
            run();
            return out;
        } finally {
            if (this.out!=null) {
                this.out.flush();
            }
            this.out = null;
        }
    }
1360362
public void openWrite()
  {
    TempCharBuffer ptr = _head;

    _head = null;
    _tail = null;

    TempCharBuffer.freeAll(ptr);
  }
1053799
private void writes() {
    int index = random.nextInt();
    for (;;) {
      Integer key = ints[index++ & MASK];
      cache.put(key, Boolean.TRUE);
      calls.increment();
    }
  }
243105
public function write()
    {
        if ($this->isModified && $this->cacheKey) {
            $this->cache->set($this->cacheKey, $this->queried);
            $this->isModified = false;
        }
    }
930407
public void sync() throws MarkLogicSesameException {
		if(WRITE_CACHE_ENABLED && timerWriteCache != null)
			timerWriteCache.forceRun();
		if(DELETE_CACHE_ENABLED && timerDeleteCache != null)
			timerDeleteCache.forceRun();
	}