Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.CyclicBarrier.await()


        final CyclicBarrier barrier = new CyclicBarrier(WORKER_COUNT+1);
        for( int i=0; i< WORKER_COUNT; i++ ) {
            new Thread() {
                public void run() {
                    try {
                        barrier.await();
                        for( int i=0; i < ENQUEUE_COUNT/WORKER_COUNT; i++ ) {
                            queue.incrementAndGet();
                            runner.wakeup();
                            yield();
                        }
View Full Code Here


                    catch (InterruptedException e) {
                    }       
                }
            }.start();
        }
        barrier.await();
       
        boolean b = doneCountDownLatch.await(30, TimeUnit.SECONDS);
        long end = System.currentTimeMillis();
        log.info("Iterations: "+iterations.get());
        log.info("counter: "+counter.get());
View Full Code Here

                        objectUnderTest_.getMessageBlocking();
                    }

                    received.set(true);

                    barrier.await();
                } catch (Exception e)
                {
                    fail();
                }
            }
View Full Code Here

                    objectUnderTest_.enqeue(mesg.getHandle());

                    delivered.set(true);

                    barrier.await();
                } catch (Exception e)
                {
                    fail();
                }
            }
View Full Code Here

                }
                finally
                {
                    try
                    {
                        barrier.await();
                    } catch (InterruptedException e)
                    {
                        // ignored
                    } catch (BrokenBarrierException e)
                    {
View Full Code Here

                }
                finally
                {
                    try
                    {
                        barrier.await();
                    } catch (InterruptedException e)
                    {
                        // ignored
                    } catch (BrokenBarrierException 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.