Examples of attempt()


Examples of EDU.oswego.cs.dl.util.concurrent.Semaphore.attempt()

               // with too many messages sent after activation -- we want
               // to compare transferred state with the sender
               stressors[i].stopPuts();
               log.info("TEST: Run " + x + "-- /" + names[i] + " activated on A");
               // Reacquire one semaphore ticket
               boolean acquired = semaphore.attempt(60000);
               if (!acquired)
                  fail("failed to acquire semaphore " + names[i]);
               log.info("TEST: Run " + x + "-- acquired semaphore from " + names[i]);
              
               // Pause to allow other work to proceed
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Sync.attempt()

               int duration = rand.nextInt((int) SLEEP_MSECS);
               _sleep(SLEEP_MSECS);
               Sync rlock = null;
               try {
                  rlock = lock_.readLock();
                  if (!rlock.attempt(msecs)) {
                     log("Read lock attempt failed.");
//                     fail("Read lock attempt failed.");
                     counter++;
                     continue;
                  }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Sync.attempt()

               int duration = rand.nextInt((int) SLEEP_MSECS);
               _sleep(SLEEP_MSECS + duration);
               Sync wlock = null;
               try {
                  wlock = lock_.writeLock();
                  if (!wlock.attempt(msecs)) {
                     log("Write lock attempt failed.");
//                     fail("Write lock attempt failed.");
                     counter++;
                     continue;
                  }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Sync.attempt()

               _sleep(SLEEP_MSECS);
               Sync rlock = null;
               Sync wlock = null;
               try {
                  rlock = lock_.readLock();
                  if (!wlock.attempt(msecs)) {
                     log("Read lock attempt failed.");
//                   fail("Read lock attempt failed.");
                     counter++;
                     continue;
                  }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Sync.attempt()

      {
         public void run()
         {
               Sync rlock = lock_.readLock();
            try {
               if (! rlock.attempt(msecs)) {
                  logX(caseNum+"-"+name+" requesting read lock failed!\n");
                  String str = caseNum + "-" + name + "-RL-0";
                  postLockingResult(str);
                  return;
               }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Sync.attempt()

      {
         public void run()
         {
            try {
               Sync wlock = lock_.writeLock();
               if (! wlock.attempt(msecs)) {
                  logX(caseNum+"-"+name+" requesting write lock failed!\n");
                  String str = caseNum + "-" + name + "-WL-0";
                  postLockingResult(str);
                  return;
               }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Sync.attempt()

   protected void acquireReadLock(final String caseNum, final String name,
                                  final long msecs, final String errMsg)
   {
            try {
               Sync rlock = lock_.readLock();
               if (! rlock.attempt(msecs)) {
                  logX(caseNum+"-"+name+" requesting read lock failed!\n");
                  String str = caseNum + "-" + name + "-RL-0";
                  postLockingResult(str);
                  return;
               }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Sync.attempt()

   protected void acquireWriteLock(final String caseNum, final String name,
                                   final long msecs, final String errMsg)
   {
            try {
               Sync wlock = lock_.writeLock();
               if (! wlock.attempt(msecs)) {
                  logX(caseNum+"-"+name+" requesting write lock failed!\n");
                  String str = caseNum + "-" + name + "-WL-0";
                  postLockingResult(str);
                  return;
               }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Sync.attempt()

      {
         public void run()
         {
               Sync rlock = lock_.readLock();
            try {
               if (! rlock.attempt(msecs)) {
                  logX(caseNum+"-"+name+" requesting read lock failed!\n");
                  String str = caseNum + "-" + name + "-RL-0";
                  postLockingResult(str);
                  return;
               }
View Full Code Here

Examples of com.cloudera.util.RetryHarness.attempt()

    };
    RetryHarness harness = new RetryHarness(retry, new FixedRetryPolicy(3),
        true);

    try {
      return harness.attempt();
    } catch (IOException i) {
      throw i;
    } catch (Exception e) {
      throw new IOException("Unexpected exception connecting to ZK", 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.