Add a configure flag to enable manual thread control,
allowing it to be used in opt builds as well as debug builds.