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

Issue 1996703002: Make mojo::RunLoop just use pthreads. (Closed)

Created:
4 years, 7 months ago by viettrungluu
Modified:
4 years, 7 months ago
Reviewers:
vardhan
CC:
mojo-reviews_chromium.org, gregsimon, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, yzshen+mojopublicwatch_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Make mojo::RunLoop just use pthreads. In particular, it just uses pthreads TLS stuff directly along with pthread_once(), which allows RunLoop::{SetUp,TearDown}() to be removed. This will allow us to make the "standalone" Environment like the "Chromium"/base-using Environment, i.e., not require instantiation. This will make things like ApplicationRunner more sane (since it currently has to mix two things: instantiating the Environment -- which you need to do once per "process", i.e., Mojo application binary instantiation -- and instantiating a RunLoop -- which you need to do once per thread). (Really, ApplicationRunner should just be a function, but that's another story.) Also note that I can't just use C++11 TLS (I tried: 1c4b90d52b54811cfeeb7d72fd63ee3c33006866), since it's not supported on iOS (which made Flutter sad). pthreads is OK though (including, AFAICT, pthread_once()). R=vardhan@google.com Committed: https://chromium.googlesource.com/external/mojo/+/c3b1910166bbcd211901700ead52abc3e47934ec

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -191 lines) Patch
M mojo/public/cpp/environment/lib/environment.cc View 2 chunks +0 lines, -4 lines 0 comments Download
M mojo/public/cpp/utility/BUILD.gn View 1 chunk +0 lines, -3 lines 0 comments Download
M mojo/public/cpp/utility/lib/run_loop.cc View 2 chunks +29 lines, -17 lines 1 comment Download
D mojo/public/cpp/utility/lib/thread_local.h View 1 chunk +0 lines, -54 lines 0 comments Download
D mojo/public/cpp/utility/lib/thread_local_posix.cc View 1 chunk +0 lines, -39 lines 0 comments Download
D mojo/public/cpp/utility/lib/thread_local_win.cc View 1 chunk +0 lines, -39 lines 0 comments Download
M mojo/public/cpp/utility/run_loop.h View 1 chunk +0 lines, -7 lines 0 comments Download
M mojo/public/cpp/utility/tests/run_loop_unittest.cc View 11 chunks +11 lines, -28 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 5 (1 generated)
viettrungluu
4 years, 7 months ago (2016-05-19 20:03:51 UTC) #1
vardhan
lgtm https://codereview.chromium.org/1996703002/diff/1/mojo/public/cpp/utility/lib/run_loop.cc File mojo/public/cpp/utility/lib/run_loop.cc (right): https://codereview.chromium.org/1996703002/diff/1/mojo/public/cpp/utility/lib/run_loop.cc#newcode30 mojo/public/cpp/utility/lib/run_loop.cc:30: int error = pthread_key_create(&g_current_run_loop_key, nullptr); does it make ...
4 years, 7 months ago (2016-05-19 21:37:35 UTC) #2
viettrungluu
On 2016/05/19 21:37:35, vardhan wrote: > lgtm > > https://codereview.chromium.org/1996703002/diff/1/mojo/public/cpp/utility/lib/run_loop.cc > File mojo/public/cpp/utility/lib/run_loop.cc (right): > ...
4 years, 7 months ago (2016-05-19 21:46:29 UTC) #3
viettrungluu
4 years, 7 months ago (2016-05-19 21:57:04 UTC) #5
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
c3b1910166bbcd211901700ead52abc3e47934ec (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698