Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1241)

Unified Diff: mojo/public/cpp/utility/lib/run_loop.cc

Issue 2011593002: Make RunApplication() return a MojoResult and TerminateApplication() take one. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/bindings/tests/versioning_test_service.cc ('k') | mojo/services/log/cpp/log_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(&current_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));
}
« no previous file with comments | « mojo/public/cpp/bindings/tests/versioning_test_service.cc ('k') | mojo/services/log/cpp/log_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698