@Override
	public synchronized void sync() {
		for (DBuffer d: bufmap.values()){
			synchronized(d){
				while (d.isBusy()){
					try {
						d.wait();
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
				((DBufferd) d).hold();
			}
			if (d.checkValid()){
				if (!d.checkClean()){
					d.waitClean();
				}
			}
			releaseBlock(d);
		}
	}