MCPcopy Create free account
hub / github.com/Gecode/gecode / steal

Method steal

gecode/search/par/engine.hpp:264–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

busyMethod · 0.80
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected