Threads.cpp: revert part of the upstream merge