本文介绍Exchanger工具类,然后采用Exchanger给出一个两个线程交换数值的简单实例。1.Exchanger介绍/***Asynchronizationpointatwhichtwothreadscanexchangeobjects.*Eachthreadpresentssomeobjectonentrytothe{@link#exchange*exchange}method,andreceivestheobjectpresentedbytheother*threadonreturn...
查看全文