Java™ Platform
Standard Ed. 8
compact1, compact2, compact3
java.util.concurrent
Class Exchanger<V>
-
-
Constructor Summary
Constructors
| Constructor |
Description |
Exchanger() |
Creates a new Exchanger.
|
-
Method Summary
All Methods Instance Methods Concrete Methods
| Modifier and Type |
Method |
Description |
V |
exchange(V x) |
Waits for another thread to arrive at this exchange point (unless
the current thread is interrupted),
and then transfers the given object to it, receiving its object
in return.
|
V |
exchange(V x,
long timeout,
TimeUnit unit) |
Waits for another thread to arrive at this exchange point (unless
the current thread is interrupted or
the specified waiting time elapses), and then transfers the given
object to it, receiving its object in return.
|
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Exchanger
public Exchanger()
Creates a new Exchanger.
Java™ Platform
Standard Ed. 8
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.