Example usage for Java java.util.concurrent Exchanger fields, constructors, methods, implement or subclass
The text is from its open source code.
Exchanger() Creates a new Exchanger. |
V | exchange(V x) Waits for another thread to arrive at this exchange point (unless the current thread is Thread#interrupt 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 Thread#interrupt interrupted or the specified waiting time elapses), and then transfers the given object to it, receiving its object in return. |