Examples of unlockRead()


Examples of one.nio.lock.RWLock.unlockRead()

                if (isExpired(entry)) break;
                return new Record<K, V>(this, lock, entry);
            }
        }

        lock.unlockRead();
        return null;
    }

    public WritableRecord<K, V> lockRecordForWrite(K key, boolean create) {
        long hashCode = hashCode(key);
View Full Code Here

Examples of one.nio.lock.RWLock.unlockRead()

            try {
                for (long entry; (entry = unsafe.getAddress(currentPtr)) != 0; currentPtr = entry + NEXT_OFFSET) {
                    visitor.visit(new Record<K, V>(this, lock, entry));
                }
            } finally {
                lock.unlockRead();
            }
        }
    }

    public void iterate(WritableVisitor<K, V> visitor) {
View Full Code Here

Examples of one.nio.lock.RWLock.unlockRead()

                            timestamps[samples++] = unsafe.getLong(entry + TIME_OFFSET);
                            if (samples == timestamps.length) return samples;
                        }
                    }
                } finally {
                    lock.unlockRead();
                }
                bucket = (bucket + 1) & (CONCURRENCY_LEVEL - 1);
            } while (bucket != startBucket);

            return samples;
View Full Code Here

Examples of one.nio.lock.RWLock.unlockRead()

                if (unsafe.getLong(entry + HASH_OFFSET) == hashCode && equalsAt(entry, key)) {
                    return isExpired(entry) ? null : valueAt(entry);
                }
            }
        } finally {
            lock.unlockRead();
        }

        return null;
    }
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.unlockRead()

        File file = shpFiles.acquireReadFile(SHP, this);
        // under windows the two paths can be just different in terms of case..
        assertEquals( new File(path).getCanonicalPath().toLowerCase(), file.getPath().toLowerCase());
        assertEquals(1, shpFiles.numberOfLocks());
       
        shpFiles.unlockRead(file, this);
        shpFiles.dispose();
    }
    @Test
    public void testAcquireWriteFile() throws Throwable {
        ShpFiles shpFiles = new ShpFiles("http://somefile.com/shp.shp");
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.unlockRead()

        Result<URL, State> result2 = shpFiles.tryAcquireRead(DBF, this);
        assertEquals("http://somefile.com/shp.dbf", result2.value
                .toExternalForm());
        assertEquals(3, shpFiles.numberOfLocks());

        shpFiles.unlockRead(result2.value, this);
        shpFiles.unlockRead(result1.value, testWriter);
        shpFiles.unlockRead(url, this);
        shpFiles.dispose();
    }
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.unlockRead()

        assertEquals("http://somefile.com/shp.dbf", result2.value
                .toExternalForm());
        assertEquals(3, shpFiles.numberOfLocks());

        shpFiles.unlockRead(result2.value, this);
        shpFiles.unlockRead(result1.value, testWriter);
        shpFiles.unlockRead(url, this);
        shpFiles.dispose();
    }

    @Test
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.unlockRead()

                .toExternalForm());
        assertEquals(3, shpFiles.numberOfLocks());

        shpFiles.unlockRead(result2.value, this);
        shpFiles.unlockRead(result1.value, testWriter);
        shpFiles.unlockRead(url, this);
        shpFiles.dispose();
    }

    @Test
    public void testUnlockReadAssertion() throws Throwable {
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.unlockRead()

        assertEquals("http://somefile.com/shp.shx", result1.value
                .toExternalForm());
        assertEquals(2, shpFiles.numberOfLocks());

        try {
            shpFiles.unlockRead(result1.value, this);
            throw new RuntimeException(
                    "Unlock should fail because it is in the wrong reader");
        } catch (IllegalArgumentException e) {
            // good
        } catch (RuntimeException e) {
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.unlockRead()

            // good
        } catch (RuntimeException e) {
            fail(e.getMessage());
        }

        shpFiles.unlockRead(result1.value, testWriter);
        shpFiles.unlockRead(url, this);
        shpFiles.dispose();
    }

    @Test
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.