From 435ff39871776f73c946353689ea4f0305cc4501 Mon Sep 17 00:00:00 2001 From: Mann mit Hut Date: Fri, 9 Jul 2021 17:46:51 +0200 Subject: Corrected types of thread ids obtained from the RTS While the thread ids had been changed to 64 bit words in e57b7cc6d8b1222e0939d19c265b51d2c3c2b4c0 the return type of the foreign import function used to retrieve these ids - namely 'GHC.Conc.Sync.getThreadId' - was never updated accordingly. In order to fix that this function returns now a 'CUULong'. In addition to that the types used in the thread labeling subsystem were adjusted as well and several format strings were modified throughout the whole RTS to display thread ids in a consistent and correct way. Fixes #16761 --- rts/Schedule.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rts/Schedule.c') diff --git a/rts/Schedule.c b/rts/Schedule.c index 3306f00ff3..4fe18fa769 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1358,7 +1358,7 @@ scheduleHandleThreadFinished (Capability *cap, Task *task, StgTSO *t) } } - removeThreadLabel((StgWord)task->incall->tso->id); + removeThreadLabel(task->incall->tso->id); // We no longer consider this thread and task to be bound to // each other. The TSO lives on until it is GC'd, but the @@ -2646,7 +2646,7 @@ scheduleWaitThread (StgTSO* tso, /*[out]*/HaskellObj* ret, Capability **pcap) appendToRunQueue(cap,tso); DEBUG_ONLY( id = tso->id ); - debugTrace(DEBUG_sched, "new bound thread (%lu)", (unsigned long)id); + debugTrace(DEBUG_sched, "new bound thread (%" FMT_StgThreadID ")", id); // As the TSO is bound and on the run queue, schedule() will run the TSO. cap = schedule(cap,task); @@ -2654,7 +2654,7 @@ scheduleWaitThread (StgTSO* tso, /*[out]*/HaskellObj* ret, Capability **pcap) ASSERT(task->incall->rstat != NoStatus); ASSERT_FULL_CAPABILITY_INVARIANTS(cap,task); - debugTrace(DEBUG_sched, "bound thread (%lu) finished", (unsigned long)id); + debugTrace(DEBUG_sched, "bound thread (%" FMT_StgThreadID ") finished", id); *pcap = cap; } @@ -3198,7 +3198,7 @@ resurrectThreads (StgTSO *threads) tso->global_link = gen->threads; gen->threads = tso; - debugTrace(DEBUG_sched, "resurrecting thread %lu", (unsigned long)tso->id); + debugTrace(DEBUG_sched, "resurrecting thread %" FMT_StgThreadID, tso->id); // Wake up the thread on the Capability it was last on cap = tso->cap; -- cgit v1.2.1