Package com.alibaba.otter.shared.arbitrate.impl.zookeeper.lock

Examples of com.alibaba.otter.shared.arbitrate.impl.zookeeper.lock.DistributedReentrantLock.tryLock()


        for (int i = 0; i < count; i++) {
            exeucotr.submit(new Runnable() {

                public void run() {
                    try {
                        while (lock.tryLock() == false) {
                            Thread.sleep(100 + RandomUtils.nextInt(100));
                        }

                        System.out.println("id: " + lock.getId() + " is leader: " + lock.isOwner());
                    } catch (InterruptedException e) {
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.