diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-08-06 11:51:35 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2022-08-06 11:51:35 -0400 |
commit | 6d1700b6dca6defb8768c493a1059c4215749b53 (patch) | |
tree | 80dc3968bb4073cd6f06e39a040f32a5a5360e31 /rts/Threads.c | |
parent | aa818a9f83308d0742e8f8c91cb9878182dacce5 (diff) | |
download | haskell-6d1700b6dca6defb8768c493a1059c4215749b53.tar.gz |
rts: Move thread labels into TSO
This eliminates the thread label HashTable and instead tracks this
information in the TSO, allowing us to use proper StgArrBytes arrays for
backing the label and greatly simplifying management of object lifetimes
when we expose them to the user with the coming `threadLabel#` primop.
Diffstat (limited to 'rts/Threads.c')
-rw-r--r-- | rts/Threads.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/Threads.c b/rts/Threads.c index 6b478d046f..07d0d0a180 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -112,6 +112,7 @@ createThread(Capability *cap, W_ size) ASSIGN_Int64((W_*)&(tso->alloc_limit), 0); tso->trec = NO_TREC; + tso->label = NULL; #if defined(PROFILING) tso->prof.cccs = CCS_MAIN; @@ -957,10 +958,9 @@ printThreadBlockage(StgTSO *tso) void printThreadStatus(StgTSO *t) { - debugBelch("\tthread %4lu @ %p ", (unsigned long)t->id, (void *)t); - { - void *label = lookupThreadLabel(t->id); - if (label) debugBelch("[\"%s\"] ",(char *)label); + debugBelch("\tthread %4lu @ %p ", (unsigned long)t->id, (void *)t); + if (t->label) { + debugBelch("[\"%.*s\"] ", (int)t->label->bytes, (char *)t->label->payload); } switch (t->what_next) { case ThreadKilled: |