Commit c8335469 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Merge commit 'c859d17f'

parents 5d2a1e65 c859d17f
......@@ -417,9 +417,9 @@ giveCapabilityToTask (Capability *cap USED_IF_DEBUG, Task *task)
{
ASSERT_LOCK_HELD(&cap->lock);
ASSERT(task->cap == cap);
debugTrace(DEBUG_sched, "passing capability %d to %s %p",
debugTrace(DEBUG_sched, "passing capability %d to %s %#" FMT_HexWord64,
cap->no, task->incall->tso ? "bound task" : "worker",
(void *)(size_t)task->id);
serialisableTaskId(task));
ACQUIRE_LOCK(&task->lock);
if (task->wakeup == rtsFalse) {
task->wakeup = rtsTrue;
......
......@@ -395,22 +395,6 @@ workerTaskStop (Task *task)
#endif
#ifdef DEBUG
// We don't replace this function with serialisableTaskId,
// because debug prints as pointers are more readable than random
// 64-bit intergers (especially on 32-bit architectures)
// and because we want to use this function also for non-threaded RTS.
static void *taskId(Task *task)
{
#ifdef THREADED_RTS
return (void *)(size_t)task->id;
#else
return (void *)task;
#endif
}
#endif
#if defined(THREADED_RTS)
static void OSThreadProcAttr
......@@ -483,7 +467,8 @@ interruptWorkerTask (Task *task)
ASSERT(osThreadId() != task->id); // seppuku not allowed
ASSERT(task->incall->suspended_tso); // use this only for FFI calls
interruptOSThread(task->id);
debugTrace(DEBUG_sched, "interrupted worker task %p", taskId(task));
debugTrace(DEBUG_sched, "interrupted worker task %#" FMT_HexWord64,
serialisableTaskId(task));
}
#endif /* THREADED_RTS */
......@@ -497,7 +482,8 @@ printAllTasks(void)
{
Task *task;
for (task = all_tasks; task != NULL; task = task->all_next) {
debugBelch("task %p is %s, ", taskId(task), task->stopped ? "stopped" : "alive");
debugBelch("task %#" FMT_HexWord64 " is %s, ", serialisableTaskId(task),
task->stopped ? "stopped" : "alive");
if (!task->stopped) {
if (task->cap) {
debugBelch("on capability %d, ", task->cap->no);
......
......@@ -312,7 +312,7 @@ serialisableTaskId (Task *task
#if defined(THREADED_RTS)
return serialiseTaskId(task->id);
#else
return 1;
return (TaskId) (size_t) task;
#endif
}
......
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