Examples of acquire()


Examples of EDU.oswego.cs.dl.util.concurrent.Latch.acquire()

         }
      }, "sender thread");
      senderThread.start();


      senderLatch.acquire();
      receiverLatch.acquire();

      if (testFailed)
      {
         fail("Test failed by the sender thread. Watch for exception in logs");
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.Mutex.acquire()

    }

    //Got handle to mutex, now acquire it
    try
    {
      dbMutex.acquire();
    }
    catch (InterruptedException ie)
    {
      throw new PersistenceException(ie);
    }
View Full Code Here

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

         }
        
         // Create a semaphore to gate the threads and acquire all its permits
         Semaphore semaphore = new Semaphore(count + 1);
         for (int i = 0; i <= count; i++)
            semaphore.acquire();
        
         DeployerThread[] deployers = new DeployerThread[keys.length];
         for (int i = 0; i < count; i++)
         {
            DistributedReplicantManager.ReplicantListener listener = null;
View Full Code Here

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

        // - the current thread does not hold a write lock
        for (;;) {
            Sync signal;
            // make sure writer state does not change
            Sync shared = writerStateRWLock.readLock();
            shared.acquire();
            try {
                if (activeWriter == null
                        || !hasDependency(activeWriter.changes, id)) {
                    readLockMap.addLock(id);
                    return new ReadLockImpl(id);
View Full Code Here

Examples of anvil.database.ConnectionManager.acquire()

  protected PooledConnection getConnection() throws SQLException
  {
    ConnectionManager manager = _zone.getManagerFor(_poolname);
    if (manager != null) {
      return manager.acquire(_poolname);
    } else {
      throw new NoConnectionPoolException(_poolname);
    }
  }
 
View Full Code Here

Examples of anvil.database.ConnectionManager.acquire()

    javax.naming.Context ctx = null;

    try {

      ConnectionManager manager = context.address().getZone().getManagerFor(ckey);
      connImpl = manager.acquire(ckey);
      return connImpl;

    } catch (CannotReturnPooledConnectionException e) {
      throw context.AcquireError(e.getMessage());
     
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jetty.io.ByteBufferPool.acquire()

        try
        {
            HttpClient client = getHttpChannel().getHttpDestination().getHttpClient();
            ByteBufferPool bufferPool = client.getByteBufferPool();
            ByteBuffer header = bufferPool.acquire(client.getRequestBufferSize(), false);
            ByteBuffer chunk = null;

            ByteBuffer contentBuffer = null;
            boolean lastContent = false;
            if (!expects100Continue(request))
View Full Code Here

Examples of com.google.code.http4j.ConnectionManager.acquire()

  public void setMaxConnectionsPerHost() throws InterruptedException,
      ExecutionException, TimeoutException, IOException {
    final ConnectionManager pool = new ConnectionPool();
    pool.setMaxConnectionsPerHost(1);
    try {
      Connection connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      pool.release(connection);
      connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      ExecutorService service = Executors.newSingleThreadExecutor();
View Full Code Here

Examples of com.google.code.http4j.ConnectionManager.acquire()

    pool.setMaxConnectionsPerHost(1);
    try {
      Connection connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      pool.release(connection);
      connection = pool.acquire(host);
      Assert.assertNotNull(connection);
      ExecutorService service = Executors.newSingleThreadExecutor();
      service.invokeAny(Collections.singleton(new Callable<Connection>() {
        @Override
        public Connection call() throws Exception {
View Full Code Here

Examples of com.google.code.http4j.ConnectionManager.acquire()

      Assert.assertNotNull(connection);
      ExecutorService service = Executors.newSingleThreadExecutor();
      service.invokeAny(Collections.singleton(new Callable<Connection>() {
        @Override
        public Connection call() throws Exception {
          return pool.acquire(host);
        }
      }), 2, TimeUnit.SECONDS);
    } finally {
      pool.shutdown();
    }
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.