Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.Lock.unlock()


            }

            //save our changes and return
            applicationDataRepository.save(applicationData);
        } finally {
            lock.unlock();
            lockService.returnLock(lock);
        }
        return ImmediateFuture.newInstance(null);
    }
View Full Code Here


            }

            //save our changes and return
            applicationDataRepository.save(applicationData);
        } finally {
            lock.unlock();
            lockService.returnLock(lock);
        }
        return ImmediateFuture.newInstance(null);
    }
View Full Code Here

                try {
                    lck.lock();
                    cnd.signalAll(); // this is the spurious wakeup
                } finally {
                    lck.unlock();
                }

                // now give the waiting thread some time to register a wakeup
                Thread.sleep(100);
View Full Code Here

        try {
            lck.lock();
            wt.wakeup();
        } finally {
            lck.unlock();
        }
        ath.join(10000);

        assertFalse("thread still waiting", ath.isWaiting());
        assertNull("thread caught exception", ath.getException());
View Full Code Here

            wt.wakeup();
            fail("missing waiter not detected");
        } catch (IllegalStateException isx) {
            // expected
        } finally {
            lck.unlock();
        }

        AwaitThread ath1 = new AwaitThread(wt, lck, null);
        ath1.start();
        Thread.sleep(100); // give extra thread time to block
View Full Code Here

            }

            support.firePropertyChange("resources", oldResources,
                    resources);
        } finally {
            writeLock.unlock();
        }
    }


    @Override
View Full Code Here

        } catch (Throwable t) {
            ExceptionUtils.handleThrowable(t);
            log.error(sm.getString("standardContext.resourcesStop"), t);
            ok = false;
        } finally {
            writeLock.unlock();
        }

        return ok;
    }
View Full Code Here

            if (parent != null)
                return parent.getCluster();

            return null;
        } finally {
            readLock.unlock();
        }
    }


    /*
 
View Full Code Here

        Lock readLock = clusterLock.readLock();
        readLock.lock();
        try {
            return cluster;
        } finally {
            readLock.unlock();
        }
    }


    /**
 
View Full Code Here

                } catch (LifecycleException e) {
                    log.error("ContainerBase.setCluster: start: ", e);
                }
            }
        } finally {
            writeLock.unlock();
        }

        // Report this property change to interested listeners
        support.firePropertyChange("cluster", oldCluster, cluster);
    }
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.