Remove envlock, add env thread.