- Update the pointers from the task list
-
- These are treated as weak pointers because we want to allow a main
- thread to get a BlockedOnDeadMVar exception in the same way as any
- other thread. Note that the threads should all have been retained
- by GC by virtue of being on the all_threads list, we're just
- updating pointers here.
- ------------------------------------------------------------------------- */
-
-static void
-update_task_list (void)
-{
- Task *task;
- StgTSO *tso;
- for (task = all_tasks; task != NULL; task = task->all_link) {
- if (!task->stopped && task->tso) {
- ASSERT(task->tso->bound == task);
- tso = (StgTSO *) isAlive((StgClosure *)task->tso);
- if (tso == NULL) {
- barf("task %p: main thread %d has been GC'd",
-#ifdef THREADED_RTS
- (void *)task->id,
-#else
- (void *)task,
-#endif
- task->tso->id);
- }
- task->tso = tso;
- }
- }
-}
-
-/* ----------------------------------------------------------------------------