[concurrency-interest] Calling Future.get() after callingFuture.cancel() returned false

Peter Kovacs peter.kovacs.1.0rc at gmail.com
Thu Mar 1 16:08:15 EST 2007


:-(

It would have made life too easy.

P.

On 3/1/07, Jason Mehrens <jason_mehrens at hotmail.com> wrote:
> >Does it make sense to call Future.get() after calling Future.cancel()
> >returned false?
>
> Not for the FutureTask implementation.  After cancel() is called, get() will
> always throw a CancellationException (with no execution exception chain).
> You could create a custom Future or Callable proxy to trap any Throwable
> that occurs.  In JDK7 (post 6464365), you can override
> FutureTask.setException()
>
> Regards,
>
> Jason Mehrens
>
> _________________________________________________________________
> Rates near 39yr lows!  $430K Loan for $1,399/mo - Paying Too Much? Calculate
> new payment
> http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-18226&moid=7581
>
>


More information about the Concurrency-interest mailing list