Package org.apache.commons.transaction.util

Examples of org.apache.commons.transaction.util.RendezvousBarrier.reset()


                public void run() {
                    try {
                        try {
                            synchronized (start) {
                                start.meet();
                                start.reset();
                            }
                            manager.readLock(owner3, res1);
                            manager.readLock(owner3, res2);
                            manager.upgradeLock(owner3, res3);
                            manager.writeLock(owner3, res3);
View Full Code Here


                public void run() {
                    try {
                        try {
                            synchronized (start) {
                                start.meet();
                                start.reset();
                            }
                            manager.readLock(owner4, res1);
                            manager.readLock(owner4, res2);
                            manager.upgradeLock(owner4, res3);
                            manager.writeLock(owner4, res3);
View Full Code Here

            try {
                try {
                    synchronized (start) {
                        start.meet();
                        start.reset();
                    }
                    manager.readLock("reader", res1);
                    manager.readLock("reader", res2);
                    manager.readLock("reader", res3);
View Full Code Here

                        rm.startTransaction("tx1");
                        // first both threads get a lock, this one on res2
                        rm.createResource("tx1", "key2");
                        synchronized (deadlockBarrier1) {
                            deadlockBarrier1.meet();
                            deadlockBarrier1.reset();
                        }
                        // if I am first, the other thread will be dead, i.e.
                        // exactly one
                        rm.createResource("tx1", "key1");
                        rm.commitTransaction("tx1");
View Full Code Here

            try {
                // first both threads get a lock, this one on res2
                rm.deleteResource("tx2", "key1");
                synchronized (deadlockBarrier1) {
                    deadlockBarrier1.meet();
                    deadlockBarrier1.reset();
                }
                //          if I am first, the other thread will be dead, i.e. exactly
                // one
                rm.deleteResource("tx2", "key2");
                rm.commitTransaction("tx2");
View Full Code Here

                    txMap1.put("key1", "value2");
                    txMap1.commitTransaction();
                    afterCommitBarrier.call();
                } catch (InterruptedException e) {
                    logger.log(Level.WARNING, "Thread interrupted", e);
                    afterCommitBarrier.reset();
                    beforeCommitBarrier.reset();
                }
            }
        }, "Thread1");
View Full Code Here

          txMap1.put("key1", "value2");
          txMap1.commitTransaction();
          afterCommitBarrier.call();
        } catch (InterruptedException e) {
          logger.log(Level.WARNING, "Thread interrupted", e);
          afterCommitBarrier.reset();
          beforeCommitBarrier.reset();
        }
      }
    }, "Thread1");
View Full Code Here

                    try {
                        // first both threads get a lock, this one on res2
                        txMap1.put("key2", "value2");
                        synchronized (deadlockBarrier1) {
                            deadlockBarrier1.meet();
                            deadlockBarrier1.reset();
                        }
                        // if I am first, the other thread will be dead, i.e.
                        // exactly one
                        txMap1.put("key1", "value2");
                        txMap1.commitTransaction();
View Full Code Here

            try {
                // first both threads get a lock, this one on res2
                txMap1.get("key1");
                synchronized (deadlockBarrier1) {
                    deadlockBarrier1.meet();
                    deadlockBarrier1.reset();
                }
                //          if I am first, the other thread will be dead, i.e. exactly
                // one
                txMap1.get("key2");
                txMap1.commitTransaction();
View Full Code Here

                    txMap1.put("key1", "value2");
                    txMap1.commitTransaction();
                    afterCommitBarrier.call();
                } catch (InterruptedException e) {
                    logger.log(Level.WARNING, "Thread interrupted", e);
                    afterCommitBarrier.reset();
                    beforeCommitBarrier.reset();
                }
            }
        }, "Thread1");
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.