Commit 7e790b38 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

rts: Label all threads created by the RTS

Reviewers: austin, erikd, simonmar

Reviewed By: simonmar

Subscribers: pacak, rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D4068
parent 5dab5442
......@@ -14,6 +14,7 @@
#include "Trace.h"
#include "Prelude.h"
#include "Sparks.h"
#include "ThreadLabels.h"
#include "sm/HeapAlloc.h"
#if defined(THREADED_RTS)
......@@ -43,7 +44,7 @@ createSparkThread (Capability *cap)
tso = createIOThread (cap, RtsFlags.GcFlags.initialStkSize,
(StgClosure *)runSparks_closure);
labelThread(cap, tso, "spark evaluator");
traceEventCreateSparkThread(cap, tso->id);
appendToRunQueue(cap,tso);
......
......@@ -14,6 +14,7 @@
#include "Weak.h"
#include "Schedule.h"
#include "Prelude.h"
#include "ThreadLabels.h"
#include "Trace.h"
void
......@@ -151,5 +152,7 @@ scheduleFinalizers(Capability *cap, StgWeak *list)
rts_mkInt(cap,n)),
(StgClosure *)arr)
);
scheduleThread(cap,t);
labelThread(cap, t, "weak finalizer thread");
}
......@@ -16,6 +16,7 @@
#include "Prelude.h"
#include "Ticker.h"
#include "Stable.h"
#include "ThreadLabels.h"
#include "Libdw.h"
#if defined(alpha_HOST_ARCH)
......@@ -471,14 +472,16 @@ startSignalHandlers(Capability *cap)
// freed by runHandler
memcpy(info, next_pending_handler, sizeof(siginfo_t));
scheduleThread(cap,
StgTSO *t =
createIOThread(cap,
RtsFlags.GcFlags.initialStkSize,
rts_apply(cap,
rts_apply(cap,
&base_GHCziConcziSignal_runHandlersPtr_closure,
rts_mkPtr(cap, info)),
rts_mkInt(cap, info->si_signo))));
RtsFlags.GcFlags.initialStkSize,
rts_apply(cap,
rts_apply(cap,
&base_GHCziConcziSignal_runHandlersPtr_closure,
rts_mkPtr(cap, info)),
rts_mkInt(cap, info->si_signo)));
scheduleThread(cap, t);
labelThread(cap, t, "signal handler thread");
}
unblockUserSignals();
......
......@@ -183,13 +183,15 @@ void startSignalHandlers(Capability *cap)
handler = deRefStablePtr((StgStablePtr)console_handler);
while (stg_pending_events > 0) {
stg_pending_events--;
scheduleThread(cap,
StgTSO *t =
createIOThread(cap,
RtsFlags.GcFlags.initialStkSize,
rts_apply(cap,
(StgClosure *)handler,
rts_mkInt(cap,
stg_pending_buf[stg_pending_events]))));
RtsFlags.GcFlags.initialStkSize,
rts_apply(cap,
(StgClosure *)handler,
rts_mkInt(cap,
stg_pending_buf[stg_pending_events])));
scheduleThread(cap, t);
labelThread(cap, t, "signal handler thread");
}
RELEASE_LOCK(&sched_mutex);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment