Searched refs:timeout (Results 1 - 25 of 52) sorted by relevance

123

/libcore/luni/src/main/java/java/util/concurrent/
H A DBlockingDeque.java275 * @param timeout how long to wait before giving up, in units of
278 * {@code timeout} parameter
288 boolean offerFirst(E e, long timeout, TimeUnit unit) argument
297 * @param timeout how long to wait before giving up, in units of
300 * {@code timeout} parameter
310 boolean offerLast(E e, long timeout, TimeUnit unit) argument
336 * @param timeout how long to wait before giving up, in units of
339 * {@code timeout} parameter
344 E pollFirst(long timeout, TimeUnit unit) argument
352 * @param timeout ho
360 pollLast(long timeout, TimeUnit unit) argument
477 offer(E e, long timeout, TimeUnit unit) argument
528 poll(long timeout, TimeUnit unit) argument
[all...]
H A DBlockingQueue.java210 * @param timeout how long to wait before giving up, in units of
213 * {@code timeout} parameter
223 boolean offer(E e, long timeout, TimeUnit unit) argument
239 * @param timeout how long to wait before giving up, in units of
242 * {@code timeout} parameter
247 E poll(long timeout, TimeUnit unit) argument
H A DCompletionService.java85 * @param timeout how long to wait before giving up, in units of
88 * {@code timeout} parameter
94 Future<V> poll(long timeout, TimeUnit unit) throws InterruptedException; argument
H A DFuture.java128 * @param timeout the maximum time to wait
129 * @param unit the time unit of the timeout argument
138 V get(long timeout, TimeUnit unit) argument
H A DTransferQueue.java80 * before the timeout elapses.
90 * @param timeout how long to wait before giving up, in units of
93 * {@code timeout} parameter
105 boolean tryTransfer(E e, long timeout, TimeUnit unit) argument
H A DCountDownLatch.java239 * @param timeout the maximum time to wait
240 * @param unit the time unit of the {@code timeout} argument
246 public boolean await(long timeout, TimeUnit unit) argument
248 return sync.tryAcquireSharedNanos(1, unit.toNanos(timeout));
H A DExecutorService.java161 * request, or the timeout occurs, or the current thread is
164 * @param timeout the maximum time to wait
165 * @param unit the time unit of the timeout argument
167 * {@code false} if the timeout elapsed before termination
170 boolean awaitTermination(long timeout, TimeUnit unit) argument
250 * when all complete or the timeout expires, whichever happens first.
260 * @param timeout the maximum time to wait
261 * @param unit the time unit of the timeout argument
275 long timeout, TimeUnit unit)
302 * an exception), if any do before the given timeout elapse
274 invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
321 invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
[all...]
H A DTimeUnit.java23 * the following code will timeout in 50 milliseconds if the {@link
30 * while this code will timeout in 50 seconds:
35 * Note however, that there is no guarantee that a particular timeout
267 * This is a convenience method that converts timeout arguments
275 * public synchronized Object poll(long timeout, TimeUnit unit)
278 * unit.timedWait(this, timeout);
284 * @param timeout the maximum time to wait. If less than
288 public void timedWait(Object obj, long timeout) argument
290 if (timeout > 0) {
291 long ms = toMillis(timeout);
308 timedJoin(Thread thread, long timeout) argument
327 sleep(long timeout) argument
[all...]
H A DSemaphore.java372 * @param timeout the maximum time to wait for a permit
373 * @param unit the time unit of the {@code timeout} argument
378 public boolean tryAcquire(long timeout, TimeUnit unit) argument
380 return sync.tryAcquireSharedNanos(1, unit.toNanos(timeout));
543 * @param timeout the maximum time to wait for the permits
544 * @param unit the time unit of the {@code timeout} argument
550 public boolean tryAcquire(int permits, long timeout, TimeUnit unit) argument
553 return sync.tryAcquireSharedNanos(permits, unit.toNanos(timeout));
H A DExecutorCompletionService.java171 public Future<V> poll(long timeout, TimeUnit unit) argument
173 return completionQueue.poll(timeout, unit);
H A DLinkedBlockingDeque.java374 public boolean offerFirst(E e, long timeout, TimeUnit unit) argument
378 long nanos = unit.toNanos(timeout);
397 public boolean offerLast(E e, long timeout, TimeUnit unit) argument
401 long nanos = unit.toNanos(timeout);
480 public E pollFirst(long timeout, TimeUnit unit) argument
482 long nanos = unit.toNanos(timeout);
498 public E pollLast(long timeout, TimeUnit unit) argument
500 long nanos = unit.toNanos(timeout);
625 public boolean offer(E e, long timeout, TimeUnit unit) argument
627 return offerLast(e, timeout, uni
652 poll(long timeout, TimeUnit unit) argument
[all...]
H A DExecutors.java183 * properties but different details (for example, timeout parameters)
588 public boolean awaitTermination(long timeout, TimeUnit unit) argument
590 return e.awaitTermination(timeout, unit);
606 long timeout, TimeUnit unit)
608 return e.invokeAll(tasks, timeout, unit);
615 long timeout, TimeUnit unit)
617 return e.invokeAny(tasks, timeout, unit);
605 invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
614 invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
H A DCyclicBarrier.java88 * point prematurely because of interruption, failure, or timeout, all
344 * <li>The specified timeout elapses; or
383 * @param timeout the time to wait for the barrier
384 * @param unit the time unit of the timeout parameter
390 * @throws TimeoutException if the specified timeout elapses
397 public int await(long timeout, TimeUnit unit) argument
401 return dowait(true, unit.toNanos(timeout));
408 * barrier due to interruption or timeout since
H A DAbstractExecutorService.java192 long timeout, TimeUnit unit)
194 return doInvokeAny(tasks, true, unit.toNanos(timeout));
229 long timeout, TimeUnit unit)
233 long nanos = unit.toNanos(timeout);
191 invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
228 invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) argument
/libcore/luni/src/main/java/java/nio/channels/
H A DSelector.java113 * the calling thread is interrupted or the specified {@code timeout}
116 * @param timeout
117 * the non-negative timeout in millisecond; 0 will block forever
123 * if the given timeout argument is less than zero.
127 public abstract int select(long timeout) throws IOException; argument
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
H A DSelectorTest.java267 // make sure select(timeout) doesn't block
455 private void assert_select_SelectorClosed(SelectType type, int timeout) argument
460 selectOnce(type, timeout);
467 private void assert_select_OP_ACCEPT(SelectType type, int timeout) argument
474 int count = blockingSelect(type, timeout);
482 count = selectOnce(type, timeout);
501 private void assert_select_OP_CONNECT(SelectType type, int timeout) argument
508 int count = blockingSelect(type, timeout);
516 count = selectOnce(type, timeout);
537 private void assert_select_OP_READ(SelectType type, int timeout) argument
610 assert_select_OP_WRITE(SelectType type, int timeout) argument
645 blockingSelect(SelectType type, int timeout) argument
660 selectOnce(SelectType type, int timeout) argument
[all...]
/libcore/luni/src/test/java/libcore/java/net/
H A DOldAndroidDatagramTest.java167 // Regression test for issue 1018003: DatagramSocket ignored a set timeout.
170 int timeout = 5000;
175 sock.setSoTimeout(timeout);
180 if (Math.abs(delay - timeout) > 1000) {
181 fail("timeout was not accurate. expected: " + timeout
/libcore/luni/src/main/java/java/nio/
H A DSelectorImpl.java156 @Override public int select(long timeout) throws IOException { argument
157 if (timeout < 0) {
158 throw new IllegalArgumentException("timeout < 0: " + timeout);
160 // Our timeout is interpreted differently to Unix's --- 0 means block. See selectNow.
161 return selectInternal((timeout == 0) ? -1 : timeout);
168 private int selectInternal(long timeout) throws IOException { argument
174 boolean isBlocking = (timeout != 0);
184 rc = Libcore.os.poll(pollFds.array(), (int) timeout);
[all...]
/libcore/luni/src/main/java/java/net/
H A DSocket.java423 * Returns this socket's {@link SocketOptions#SO_LINGER linger} timeout in seconds, or -1
454 * Returns this socket's {@link SocketOptions#SO_TIMEOUT receive timeout}.
519 * Sets this socket's {@link SocketOptions#SO_LINGER linger} timeout in seconds.
520 * If {@code on} is false, {@code timeout} is irrelevant.
522 public void setSoLinger(boolean on, int timeout) throws SocketException { argument
525 if (on && timeout < 0) {
526 throw new IllegalArgumentException("timeout < 0");
529 impl.setOption(SocketOptions.SO_LINGER, Integer.valueOf(timeout));
536 * Sets this socket's {@link SocketOptions#SO_TIMEOUT read timeout} in milliseconds.
537 * Use 0 for no timeout
540 setSoTimeout(int timeout) argument
846 connect(SocketAddress remoteAddr, int timeout) argument
[all...]
H A DServerSocket.java194 * Gets the socket {@link SocketOptions#SO_TIMEOUT accept timeout}.
240 * Sets the {@link SocketOptions#SO_TIMEOUT accept timeout} in milliseconds for this socket.
241 * This accept timeout defines the period the socket will block waiting to
243 * {@code 0} (default) is used to set an infinite timeout. To have effect
246 * @param timeout the timeout in milliseconds or 0 for no timeout.
250 public synchronized void setSoTimeout(int timeout) throws SocketException { argument
252 if (timeout < 0) {
253 throw new IllegalArgumentException("timeout <
[all...]
H A DInetAddress.java674 * @param timeout
675 * timeout in milliseconds before the test fails if no connection
682 * if timeout is less than zero.
684 public boolean isReachable(int timeout) throws IOException { argument
685 return isReachable(null, 0, timeout);
698 * @param timeout
699 * timeout in milliseconds before the test fails if no connection
706 * if ttl or timeout is less than zero.
708 public boolean isReachable(NetworkInterface networkInterface, final int ttl, final int timeout) throws IOException { argument
709 if (ttl < 0 || timeout <
753 isReachable(InetAddress destination, InetAddress source, int timeout) argument
[all...]
H A DSocketImpl.java252 * by the {@code SocketAddress} object with the given timeout. This method
253 * will block indefinitely if the timeout is set to zero.
257 * @param timeout
258 * the timeout value in milliseconds.
262 protected abstract void connect(SocketAddress remoteAddr, int timeout) throws IOException; argument
H A DPlainSocketImpl.java104 // Reset the client's inherited read timeout to the Java-specified default of 0.
173 * @param timeout
174 * a timeout where supported. 0 means no timeout
178 private void connect(InetAddress anAddr, int aPort, int timeout) throws IOException { argument
183 IoBridge.connect(fd, normalAddr, aPort, timeout);
319 private void socksConnect(InetAddress applicationServerAddress, int applicationServerPort, int timeout) throws IOException { argument
321 IoBridge.connect(fd, socksGetServerAddress(), socksGetServerPort(), timeout);
454 protected void connect(SocketAddress remoteAddr, int timeout) throws IOException { argument
456 connect(inetAddr.getAddress(), inetAddr.getPort(), timeout);
[all...]
/libcore/luni/src/main/java/java/util/concurrent/locks/
H A DReentrantLock.java354 * lock.tryLock(timeout, unit)) {
402 * @param timeout the time to wait for the lock
403 * @param unit the time unit of the timeout argument
411 public boolean tryLock(long timeout, TimeUnit unit) argument
413 return sync.tryAcquireNanos(1, unit.toNanos(timeout));
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
H A DSocketImplTest.java126 protected void connect(SocketAddress remoteAddr, int timeout) argument

Completed in 291 milliseconds

123