Package java.util.concurrent.locks

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


                    log.error(msg);
                    throw new SynapseException(msg);
                }
            }
        } finally {
            readLock.unlock();
        }
    }       

    public Member getNextApplicationMember(AlgorithmContext algorithmContext) {
        throw new UnsupportedOperationException("This algorithm doesn't operate on Members");
View Full Code Here


            calculate();

            reset(null);
        } finally {
            writeLock.unlock();
        }
    }

    public int[] getWeights() {
        int weights[] = new int[endpointStates.length];
View Full Code Here

                        lock.lock();
                        try {
                            all_msgs_delivered.signalAll();
                        }
                        finally {
                            lock.unlock();
                        }
                    }
                }
                return null;
            }
View Full Code Here

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

        long time=System.currentTimeMillis() - start;
        double requests_sec=num_msgs / (time / 1000.0);
        System.out.println("\nTime: " + time + " ms, " + Util.format(requests_sec) + " requests / sec\n");
View Full Code Here

            while(System.currentTimeMillis() < target_time && done.get() == false) {
                cond.await(1000, TimeUnit.MILLISECONDS);
            }
        }
        finally {
            lock.unlock();
        }

        Util.sleep(500);
        View view=c1.getView();
        System.out.println("view=" + view);
View Full Code Here

                        lock.lock();
                        try {
                            all_msgs_delivered.signalAll();
                        }
                        finally {
                            lock.unlock();
                        }
                    }
                }
                return null;
            }
View Full Code Here

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

        long time=System.currentTimeMillis() - start;
        double requests_sec=num_msgs / (time / 1000.0);
        System.out.println("\nTime: " + time + " ms, " + Util.format(requests_sec) + " requests / sec\n");
View Full Code Here

                    if(x.equals(table[1][h1])) {
                        return true;
                    }
                    return false;
                } finally {
                    lock1.unlock();
                }
            }
        } finally {
            lock0.unlock();
        }
View Full Code Here

                        table[1][h1] = null;
                        return true;
                    }
                    return false;
                } finally {
                    lock1.unlock();
                }
            }
        } finally {
            lock0.unlock();
        }
View Full Code Here

    @Override
    public final void release(T x) {
        Lock lock0 = lock[0][hash0(x) % lock[0].length];
        Lock lock1 = lock[1][hash1(x) % lock[1].length];
        lock0.unlock();
        lock1.unlock();
    }
}
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.