Package EDU.oswego.cs.dl.util.concurrent

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


                message.writeBytes(new byte[1024]);
                connection.start();
               
                connectionsEstablished.release();
               
                startTest.acquire();               
                final int msgs = (MESSAGE_COUNT/PRODUCER_COUNT)+1;
                for (int i = 0; i < msgs; i++) {
                    pp.increment();
                    producer.send(message);
                }               
View Full Code Here


                            doneLatch.release();
                        }
                    }
                });
                connection.start();
                doneLatch.acquire();

                testsFinished.release();               
                connection.close();
                return null;
            }
View Full Code Here

        closerThread.start();
 
        assertNull(topicConsumer.receive(1500));
 
        // wait for the closing thread to finish
        latch.acquire();
     }
     finally
     {
       if (consumerConnection != null)
       {
View Full Code Here

                    }
                }
            });

            if( sync ) {
                latch.acquire();
            }
        }
        catch (InterruptedException e) {
            log.warn("Request to start checkpoint failed: " + e, e);
        }
View Full Code Here

         }

         // need extra commit for cases in which the last message index is not a multiple of 10
         sess.commit();

         latch.acquire();
        
         if (listener.failed)
         {
            fail("listener failed: " + listener.getError());
         }
View Full Code Here

                    }
                }
            });

            if( sync ) {
                latch.acquire();
            }
        }
        catch (InterruptedException e) {
            log.warn("Request to start checkpoint failed: " + e, e);
        }
View Full Code Here

    public void doExecute(WorkerContext work, Executor executor)
            throws WorkException, InterruptedException {
        Latch latch = work.provideEndLatch();
        executor.execute(work);
        latch.acquire();
    }
}
View Full Code Here

    public void doExecute(WorkerContext work, Executor executor)
            throws WorkException, InterruptedException {
        Latch latch = work.provideStartLatch();
        executor.execute(work);
        latch.acquire();
    }
}
View Full Code Here

    public void doExecute(WorkerContext work, Executor executor)
            throws WorkException, InterruptedException {
        Latch latch = work.provideEndLatch();
        executor.execute(work);
        latch.acquire();
    }
}
View Full Code Here

    public void doExecute(WorkerContext work, Executor executor)
            throws WorkException, InterruptedException {
        Latch latch = work.provideStartLatch();
        executor.execute(work);
        latch.acquire();
    }
}
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.