Package java.util.concurrent.locks.ReentrantReadWriteLock

Examples of java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock.lock()


     * @param request committed request
     */
    public void addCommittedProposal(Request request) {
        WriteLock wl = logLock.writeLock();
        try {
            wl.lock();
            if (committedLog.size() > commitLogCount) {
                committedLog.removeFirst();
                minCommittedLog = committedLog.getFirst().packet.getZxid();
            }
            if (committedLog.isEmpty()) {
View Full Code Here


    Field field = testClass.getClass().getDeclaredField("statsLock");
    field.setAccessible(true);
    ReentrantReadWriteLock oldLock = (ReentrantReadWriteLock) field.get(testClass);
    field.set(testClass, mockLock);
    expect(mockLock.writeLock()).andThrow(new RuntimeException()).once().andReturn(mockWriteLock).once();
    mockWriteLock.lock();
    expectLastCall().once();
    replay(mockLock, mockWriteLock);

    try{
      testClass.updateCreatedConnections(5);
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.