Package java.util.concurrent

Examples of java.util.concurrent.Semaphore.release()


      for (int i = 0; i < runners.length; i++)
      {
         runners[i].start();
      }
     
      semaphore.release(numThreads);
     
      try
      {
         assertTrue("messages received within 15 seconds", semaphore.tryAcquire(numThreads, 15, TimeUnit.SECONDS));
        
View Full Code Here


        this.loaderSteering.put(url, new Semaphore(0));
        try {
            final Response response = loadInternal(request, cacheStrategy, maxFileSize, checkBlacklist);
            check = this.loaderSteering.remove(url);
            if (check != null) check.release(1000);
            return response;
        } catch (final IOException e) {
            // release the semaphore anyway
            check = this.loaderSteering.remove(url);
            if (check != null) check.release(1000);
View Full Code Here

            if (check != null) check.release(1000);
            return response;
        } catch (final IOException e) {
            // release the semaphore anyway
            check = this.loaderSteering.remove(url);
            if (check != null) check.release(1000);
            //Log.logException(e);
            throw new IOException(e);
        }
    }
View Full Code Here

      _manager.setLocalStatelessPool(this);
   
      return beanItem;
    } finally {
      if (! isValid && semaphore != null)
        semaphore.release();
    }
  }
 
  public X getLifecycleInstance()
  {
View Full Code Here

  public void free(Item<X> beanItem)
  {
    Semaphore semaphore = _concurrentSemaphore;
    if (semaphore != null)
      semaphore.release();
   
    _manager.setLocalStatelessPool(null);
   
    if (! _freeList.free(beanItem)) {
      destroyImpl(beanItem);
View Full Code Here

    if (beanItem == null)
      return;
   
    Semaphore semaphore = _concurrentSemaphore;
    if (semaphore != null)
      semaphore.release();
   
    _manager.setLocalStatelessPool(null);
   
    destroyImpl(beanItem);
  }
View Full Code Here

    if (beanItem == null)
      return;
   
    Semaphore semaphore = _concurrentSemaphore;
    if (semaphore != null)
      semaphore.release();
  }
 
  public Class<?> getLocalApi()
  {
    return _context.getApi();
View Full Code Here

                    new RetryPolicy()
                    {
                        @Override
                        public boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleeper)
                        {
                            semaphore.release();
                            if ( retries.incrementAndGet() == MAX_RETRIES )
                            {
                                try
                                {
                                    server = new TestingServer(serverPort);
View Full Code Here

              {
                super.channelClosed(ctx, e);
              }
              finally
              {
                passMessage.release();
              }
            }
      });

      final Channel serverChannel = getServerChannelForClientConn(conn);
View Full Code Here

        public boolean check()
        {
          return bstCallback.isStreamRequestError();
        }
      }, "wait for streamRequestError callback", 1000, log);
      passMessage.release();
      log.info("finished");
    }
    finally
    {
      conn.close();
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.