| 262 | */ |
| 263 | template<class Tracer> |
| 264 | forceinline Space* |
| 265 | Engine<Tracer>::Worker::steal(unsigned long int& d, |
| 266 | Tracer& myt, Tracer& ot) { |
| 267 | /* |
| 268 | * Make a quick check whether the worker might have work |
| 269 | * |
| 270 | * If that is not true any longer, the worker will be asked |
| 271 | * again eventually. |
| 272 | */ |
| 273 | if (!path.steal()) |
| 274 | return nullptr; |
| 275 | m.acquire(); |
| 276 | Space* s = path.steal(*this,d,myt,ot); |
| 277 | m.release(); |
| 278 | // Tell that there will be one more busy worker |
| 279 | if (s != nullptr) |
| 280 | engine().busy(); |
| 281 | return s; |
| 282 | } |
| 283 | |
| 284 | /* |
| 285 | * Return No-Goods |