core: Environment#lock is more useful now