Removes all locks and ensures their content is written to disk.
353300
def remove_all_locks(self):
        """"""
        locks = list(self._locks.items())
        locks.sort(key=lambda l: l[1].get_last_access())
        for l in locks:
            self._remove_lock(l[0])
576358
public void clear()
    {
        // clear out ref queue. We don't need to expunge entries
        // since gc'ed entries won't get copied.
        emptyReferenceQueue();

        for (int i = 0; i < table.length; i++)
        {
            Entry e = table[i];
            Entry first = null;
            Entry prev = null;
            while (e != null)
            {
                Object candidate = e.get();
                if (candidate != null)
                {
                    Entry dirty = e.makeDirtyAndWeak(queue);
                    if (first == null)
                    {
                        first = dirty;
                    }
                    if (prev != null)
                    {
                        prev.setNext(dirty);
                    }
                    prev = dirty;
                }
                else
                {
                    if (prev != null)
                    {
                        prev.setNext(e.getState().next);
                    }
                    size--;
                }
                e = e.getState().next;
            }
            table[i] = first;
        }

        // Allocation of array may have caused GC, which may have caused
        // additional entries to go stale.  Removing these entries from the
        // reference queue will make them eligible for reclamation.
        expungeStaleEntries();
    }
933474
@Override
    public void clear() {
        if (emulateIsAbsent)
            lock.writeLock().lock();

        compressedEntries.clear();

        if (emulateIsAbsent)
            lock.writeLock().unlock();
    }
1209648
public function flush()
    {
        Files::emptyDirectoryRecursively($this->cacheDirectory);
        if ($this->frozen === true) {
            @unlink($this->cacheDirectory . 'FrozenCache.data');
            $this->frozen = false;
        }
    }
688774
def flush(self):
        
        annotation = self.get_annotation()
        if annotation.get(ATTACHMENTS_STORAGE) is not None:
            del annotation[ATTACHMENTS_STORAGE]
98983
def removeAll(self):
        
        rv = self._removeAll(self._reads, self._writes)
        return rv
119816
public function flush()
    {
        $removeService = GeneralUtility::makeInstance(RemoveService::class);
        $removeService->softRemoveDir(GeneralUtility::getFileAbsFileName(self::RELATIVE_STORAGE_FOLDER))->removeDirs();
        $this->freeze = false;
    }
289708
protected function flushWrites()
    {
        if ( ! $this->queuedForWrite) {
            return;
        }

        $target = $this->getOrMakeTargetInstance();

        $storedFiles = $this->handler->process($this->uploadedFile, $target, $this->config->toArray());

        if ($this->shouldVariantInformationBeStored()) {

            $originalExtension  = pathinfo($this->originalFilename(), PATHINFO_EXTENSION);
            $originalMimeType   = $this->contentType();
            $variantInformation = [];

            foreach ($storedFiles as $variant => $storedFile) {
                if (    $storedFile->extension() == $originalExtension
                    &&  $storedFile->mimeType() == $originalMimeType
                ) {
                    continue;
                }

                $variantInformation[ $variant ] = [
                    'ext'  => $storedFile->extension(),
                    'type' => $storedFile->mimeType(),
                ];
            }

            $this->instanceWrite('variants', json_encode($variantInformation));
            $this->instance->save();
        }

        $this->queuedForWrite = false;
    }
347393
private boolean cleanLockedObjects( LockedObject lo,
                                        boolean temporary ) {

        if (lo.children == null) {
            if (lo.owner == null) {
                if (temporary) {
                    lo.removeTempLockedObject();
                } else {
                    lo.removeLockedObject();
                }

                return true;
            }
            return false;
        }
        boolean canDelete = true;
        int limit = lo.children.length;
        for (int i = 0; i < limit; i++) {
            if (!cleanLockedObjects(lo.children[i], temporary)) {
                canDelete = false;
            } else {

                // because the deleting shifts the array
                i--;
                limit--;
            }
        }
        if (canDelete) {
            if (lo.owner == null) {
                if (temporary) {
                    lo.removeTempLockedObject();
                } else {
                    lo.removeLockedObject();
                }
                return true;
            }
            return false;
        }
        return false;
    }
883713
@Override
    public final void clear() {
        int spin = 0;
        for(;;) {
            final long writeLock = seqLock.tryWriteLock();
            if(writeLock > 0L) {
                final int stackTop = this.stackTop.get();
                if(stackTop>0) {
                    try {
                        for(int i = 0; i<stackTop; i++) {
                            stack.set(i, null);
                        }
                        stackNotFullCondition.signal();
                        return;
                    } finally {
                        this.stackTop.set(0);
                    }
                } else {
                    return;
                }
            }

            spin = Condition.progressiveYield(spin);
        }
    }
560862
private void clearLock() {
      Object previousValue = noCacheStoreCache.remove(keyOfLock);
      if (previousValue!=null && trace) {
         log.tracef("Lock removed for index: %s", indexName);
      }
   }
62505
void flush() {
		internalLock.writeLock().lock();
		flushLock.lock();
		try {
			if (isNew || modifiedBy.size() > 0) {
				VanillaDb.logMgr().flush(lastLsn);
				contents.write(blk);
				modifiedBy.clear();
				isNew = false;
			}
		} finally {
			flushLock.unlock();
			internalLock.writeLock().unlock();
		}
	}
980432
def clear(self):
        """"""
        for key in list(self.queue.keys()):
            if self.queue[key]['status'] in ['done', 'failed']:
                del self.queue[key]
        self.write()
1170753
def clear(self):
        """"""
        with self.lock:
            for filehandle, refcount in list(self.files.items()):
                if refcount == 0:
                    filehandle.close()
                    del self.files[filehandle]
                    del self.past[self.past.index(filehandle)]
39538
def clean(self):
        
        if not self._save_temp:
            if hasattr(self, '_written_files'):
                map(os.unlink, self._written_files)
            if getattr(self, '_remove_tempdir_on_clean', False):
                shutil.rmtree(self._tempdir)
700315
def flush(self):
        
        if self._cache_modified_count > 0:
            self.storage.write(self.cache)
            self._cache_modified_count = 0
1256802
def close(self):
        
        if self._writable and not self._closed:
            self._closed = True
            with self._seek_lock:
                self._flush_raw_or_buffered()
            if self._seek:
                with handle_os_exceptions():
                    self._close_writable()