Package com.pcmsolutions.util

Examples of com.pcmsolutions.util.RWLock


    public boolean tryLockSampleRead(SampleContext sc, Integer sample) throws NoSuchSampleException, NoSuchContextException {
        if (sc == null)
            throw new NoSuchContextException();

        RWLock pLock = (RWLock) s2sl.get(sample);
        if (pLock != null) {
            return pLock.tryRead();
        } else
            throw new NoSuchSampleException(sample);
    }
View Full Code Here


            throw new NoSuchContextException();

        if (s2sc.get(sample) != sc)
            lockSampleWrite(getParent(sc), sample);
        else {
            RWLock pLock = (RWLock) s2sl.get(sample);
            if (pLock != null)
                pLock.write();
            else
                throw new NoSuchSampleException(sample);
        }
    }
View Full Code Here

            throw new NoSuchContextException();

        if (s2sc.get(sample) != sc)
            return tryLockSampleWrite(getParent(sc), sample);
        else {
            RWLock pLock = (RWLock) s2sl.get(sample);
            if (pLock != null) {
                return pLock.tryWrite();
            } else
                throw new NoSuchSampleException(sample);
        }
    }
View Full Code Here

    public boolean isSampleWriteLocked(SampleContext sc, Integer sample) throws NoSuchSampleException, NoSuchContextException {
        if (s2sc.get(sample) != sc || sc == null)
            throw new NoSuchContextException();

        RWLock pLock = (RWLock) s2sl.get(sample);
        if (pLock == null)
            throw new NoSuchSampleException(sample);
        return pLock.isWriteLocked();
    }
View Full Code Here

TOP

Related Classes of com.pcmsolutions.util.RWLock

Copyright © 2018 www.massapicom. 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.