Merge "Change when sampling thread is reset during shutdown to prevent races."