This silences LGTM warnings that these functions are not thread-safe. (cherry picked from commit 5703f704)