Immediately call a Callable with this context as the #current context. @param c Callable to call. @return result of call.
(Callable<V> c)
| 545 | * @return result of call. |
| 546 | */ |
| 547 | @CanIgnoreReturnValue |
| 548 | public <V> V call(Callable<V> c) throws Exception { |
| 549 | Context previous = attach(); |
| 550 | try { |
| 551 | return c.call(); |
| 552 | } finally { |
| 553 | detach(previous); |
| 554 | } |
| 555 | } |
| 556 | |
| 557 | /** |
| 558 | * Wrap a {@link Runnable} so that it executes with this context as the {@link #current} context. |