Package net.openhft.chronicle.sandbox.queue

Examples of net.openhft.chronicle.sandbox.queue.SharedConcurrentBlockingObjectQueue


     * timed offer times out if full and elements not taken
     */
    @Ignore
    @Test
    public void testTimedOffer() throws Exception, IOException {
        final BlockingQueue q = new SharedConcurrentBlockingObjectQueue(2, Integer.class);
        final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
        Thread t = newStartedThread(new CheckedRunnable() {
            public void realRun() throws Exception {
                q.put(new Object());
                q.put(new Object());
                long startTime = System.nanoTime();
                assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS));
                assertTrue(millisElapsedSince(startTime) >= timeoutMillis());
                pleaseInterrupt.countDown();
                try {
                    q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS);
                    shouldThrow();
                } catch (InterruptedException success) {
                }
            }
        });
View Full Code Here

TOP

Related Classes of net.openhft.chronicle.sandbox.queue.SharedConcurrentBlockingObjectQueue

Copyright © 2018 www.massapicom. 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.