- // first try to get a spark from our own pool.
- // We should be using reclaimSpark(), because it works without
- // needing any atomic instructions:
- // spark = reclaimSpark(cap->sparks);
- // However, measurements show that this makes at least one benchmark
- // slower (prsa) and doesn't affect the others.
- spark = tryStealSpark(cap);
- if (spark != NULL) {
- cap->sparks_converted++;
-
- // Post event for running a spark from capability's own pool.
- traceSchedEvent(cap, EVENT_RUN_SPARK, cap->r.rCurrentTSO, 0);
-
- return spark;
- }