Examples of awaitLatch()


Examples of org.apache.curator.test.Timing.awaitLatch()

            client.create().forPath("/test/foo", "first".getBytes());
            Assert.assertTrue(timing.awaitLatch(addedLatch));

            client.setData().forPath("/test/foo", "something new".getBytes());
            Assert.assertTrue(timing.awaitLatch(updatedLatch));
        }
        finally
        {
            CloseableUtils.closeQuietly(client);
        }
View Full Code Here

Examples of org.apache.tomcat.util.net.NioEndpoint.KeyAttachment.awaitLatch()

                KeyAttachment att = (KeyAttachment) key.attachment();
                try {
                    if ( att.getLatch()==null || att.getLatch().getCount()==0) att.startLatch(1,SelectionKey.OP_WRITE);
                    //only register for write if a write has not yet been issued
                    if ( (att.interestOps() & SelectionKey.OP_WRITE) == 0) socket.getPoller().add(socket,SelectionKey.OP_WRITE);
                    att.awaitLatch(writeTimeout,TimeUnit.MILLISECONDS,SelectionKey.OP_WRITE);
                }catch (InterruptedException ignore) {
                    Thread.interrupted();
                }
                if ( att.getLatch()!=null && att.getLatch().getCount()> 0) {
                    //we got interrupted, but we haven't received notification from the poller.
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.