Examples of RWLock


Examples of one.nio.lock.RWLock

    public void put(K key, V value) {
        long hashCode = hashCode(key);
        long currentPtr = bucketFor(hashCode);
        int newSize = sizeOf(value);

        RWLock lock = lockFor(hashCode).lockWrite();
        try {
            for (long entry; (entry = unsafe.getAddress(currentPtr)) != 0; currentPtr = entry + NEXT_OFFSET) {
                if (unsafe.getLong(entry + HASH_OFFSET) == hashCode && equalsAt(entry, key)) {
                    int oldSize = sizeOf(entry);
                    if (newSize <= oldSize) {
                        setTimeAt(entry);
                        setValueAt(entry, value);
                        return;
                    }

                    unsafe.putAddress(currentPtr, unsafe.getAddress(entry + NEXT_OFFSET));
                    destroyEntry(entry);
                    count.decrementAndGet();
                    break;
                }
            }

            long entry = allocateEntry(key, hashCode, newSize);
            unsafe.putLong(entry + HASH_OFFSET, hashCode);
            unsafe.putAddress(entry + NEXT_OFFSET, unsafe.getAddress(currentPtr));
            setTimeAt(entry);
            setValueAt(entry, value);

            unsafe.putAddress(currentPtr, entry);
            count.incrementAndGet();
        } finally {
            lock.unlockWrite();
        }
    }
View Full Code Here

Examples of org.jacorb.trading.util.RWLock

      m_incarnation = new Incarnation();
      m_types = new Hashtable();
      writeObjects();
    }

    m_lock = new RWLock();
  }
View Full Code Here

Examples of sil.spatialindex.RWLock

  ArrayList m_readNodeCommands = new ArrayList();
  ArrayList m_deleteNodeCommands = new ArrayList();

  public RTree(PropertySet ps, IStorageManager sm)
  {
    m_rwLock = new RWLock();
    m_pStorageManager = sm;
    m_rootID = IStorageManager.NewPage;
    m_headerID = IStorageManager.NewPage;
    m_treeVariant = SpatialIndex.RtreeVariantRstar;
    m_fillFactor = 0.7f;
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.