diff options
Diffstat (limited to 'rts/Sparks.c')
-rw-r--r-- | rts/Sparks.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rts/Sparks.c b/rts/Sparks.c index aed75e52ab..75464d925b 100644 --- a/rts/Sparks.c +++ b/rts/Sparks.c @@ -58,6 +58,13 @@ createSparkThread (Capability *cap) tso = createIOThread (cap, RtsFlags.GcFlags.initialStkSize, &base_GHCziConc_runSparks_closure); + if (cap->r.rCurrentTSO != NULL) + // Capability in a bound thread? + postEvent(cap, EVENT_SPARK_TO_THREAD, cap->r.rCurrentTSO->id, tso->id); + else + // Capability in a worker thread? + postEvent(cap, EVENT_SPARK_TO_THREAD, 0, tso->id); + appendToRunQueue(cap,tso); } |