Upgrade to newest version of thread.c