Move a variable declaration closer to its usage.
Rename "output" to "thread_list".