1415161718192021222324
protected void setUp() throws Exception { super.setUp(); ReadWriteLock l=new ReentrantWriterPreferenceReadWriteLock(); rl=l.readLock(); wl=l.writeLock(); } protected void tearDown() throws Exception { super.tearDown(); }
179180181182183184185186187188189
if ( lock == null ) { lock = new FIFOReadWriteLock(); this.locks.put(file.getAbsolutePath(), lock); } } Sync sync = lock.writeLock(); try { sync.acquire(); try { OutputStream os = new FileOutputStream(file); os.write(content);
211212213214215216217218219220221