Callback to wake us up when this Deferred is running. We will wait() on the intrinsic condition of this callback.
| 1205 | * We will wait() on the intrinsic condition of this callback. |
| 1206 | */ |
| 1207 | static final class Signal implements Callback<Object, Object> { |
| 1208 | // When the callback triggers, it'll replace the reference in this |
| 1209 | // array to something other than `this' -- since the result cannot |
| 1210 | // possibly be `this'. |
| 1211 | Object result = this; |
| 1212 | |
| 1213 | private final String thread = Thread.currentThread().getName(); |
| 1214 | |
| 1215 | public Object call(final Object arg) { |
| 1216 | synchronized (this) { |
| 1217 | result = arg; |
| 1218 | super.notify(); // Guaranteed to have only 1 thread wait()ing. |
| 1219 | } |
| 1220 | return arg; |
| 1221 | } |
| 1222 | |
| 1223 | public String toString() { |
| 1224 | return "wakeup thread " + thread; |
| 1225 | } |
| 1226 | }; |
| 1227 | |
| 1228 | /** |
| 1229 | * Executes all the callbacks in the current chain. |
nothing calls this directly
no outgoing calls
no test coverage detected