Index: mojo/public/cpp/utility/lib/run_loop.cc |
diff --git a/mojo/public/cpp/utility/lib/run_loop.cc b/mojo/public/cpp/utility/lib/run_loop.cc |
index 1fde95cfecdf1d829fa2f175e9cd5c86e934a104..2f3178d7fb6e9ab70a6a5901d15e30af36192350 100644 |
--- a/mojo/public/cpp/utility/lib/run_loop.cc |
+++ b/mojo/public/cpp/utility/lib/run_loop.cc |
@@ -24,7 +24,7 @@ pthread_key_t g_current_run_loop_key; |
// Ensures that the "current run loop" functionality is available (i.e., that we |
// have a TLS slot). |
-void EnsureCurrentRunLoopInitialized() { |
+void InitializeCurrentRunLoopIfNecessary() { |
static pthread_once_t current_run_loop_key_once = PTHREAD_ONCE_INIT; |
int error = pthread_once(¤t_run_loop_key_once, []() { |
int error = pthread_key_create(&g_current_run_loop_key, nullptr); |
@@ -36,7 +36,7 @@ void EnsureCurrentRunLoopInitialized() { |
} |
void SetCurrentRunLoop(RunLoop* run_loop) { |
- EnsureCurrentRunLoopInitialized(); |
+ InitializeCurrentRunLoopIfNecessary(); |
int error = pthread_setspecific(g_current_run_loop_key, run_loop); |
MOJO_ALLOW_UNUSED_LOCAL(error); |
@@ -71,7 +71,7 @@ RunLoop::~RunLoop() { |
// static |
RunLoop* RunLoop::current() { |
- EnsureCurrentRunLoopInitialized(); |
+ InitializeCurrentRunLoopIfNecessary(); |
return static_cast<RunLoop*>(pthread_getspecific(g_current_run_loop_key)); |
} |