Package java.util.concurrent.locks.ReentrantReadWriteLock

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


                            + "]", e);
                    }
                }
            }
        } finally {
            lock.unlock();
        }
    }

    /**
     * Saves the current state of the application (package) versions to disk. The values will be saved scoped to the
View Full Code Here


                    }
                }

            }
        } finally {
            lock.unlock();
        }
    }

    /**
     * Retrieves the version for the package identified by the supplied package key. This method will synchronize
View Full Code Here

                                .getAllMessages(t));
                            return new GenericCommandResponse(command, false, null, t);
                        }
                    }
                } finally {
                    writeLock.unlock();
                }
            } else {
                Throwable t = new Throwable("Initialize callback lock could not be acquired");
                LOG.error(CommI18NResourceKeys.INITIALIZE_CALLBACK_FAILED, t.getMessage());
                return new GenericCommandResponse(command, false, null, t);
View Full Code Here

            }

            // Downgrade the lock
            try {
                readLock.lock();
                writeLock.unlock();
                writeToSocket();
            } finally {
                readLock.unlock();
            }
        } finally {
View Full Code Here

            }
        } finally {
            // Should have been released above but may not have been on some
            // exception paths
            if (writeLock.isHeldByCurrentThread()) {
                writeLock.unlock();
            }
        }
    }

    private synchronized void writeToSocket() throws IOException {
View Full Code Here

                // Set the current settings for this socket
                Socket.optSet(socket, Socket.APR_SO_NONBLOCK, (block ? 0 : 1));
                // Downgrade the lock
                try {
                    readLock.lock();
                    writeLock.unlock();
                    result = Socket.sendbb(socket, pos, len);
                } finally {
                    readLock.unlock();
                }
            } finally {
View Full Code Here

                }
            } finally {
                // Should have been released above but may not have been on some
                // exception paths
                if (writeLock.isHeldByCurrentThread()) {
                    writeLock.unlock();
                }
            }
        }

        return result;
View Full Code Here

                    Socket.timeoutSet(socket, 0);
                }
                // Downgrade the lock
                try {
                    readLock.lock();
                    writeLock.unlock();
                    result = Socket.recvbb(socket, 0, buf.length - lastValid);
                } finally {
                    readLock.unlock();
                }
            } finally {
View Full Code Here

                }
            } finally {
                // Should have been released above but may not have been on some
                // exception paths
                if (writeLock.isHeldByCurrentThread()) {
                    writeLock.unlock();
                }
            }
        }

        return result;
View Full Code Here

                // Set the current settings for this socket
                Socket.optSet(socket, Socket.APR_SO_NONBLOCK, (block ? 0 : 1));
                // Downgrade the lock
                try {
                    readLock.lock();
                    writeLock.unlock();
                    result = Socket.recvbb(socket, pos, len);
                } finally {
                    readLock.unlock();
                }
            } finally {
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.