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

Issue 2833993003: Move autowrap from ThreadManager constructor to Thread::Current. (Closed)

Created:
3 years, 8 months ago by nisse-webrtc
Modified:
3 years, 8 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Move autowrap from ThreadManager constructor to Thread::Current. This is in preparation for a WrapCurrentThread method, or AutoThread constructor, taking a socket server as argument, to eliminate the need for the MessageQueue::set_socketserver method and its lock. No intended change in behaviour; the ThreadManager constructor records the calling thread id, and autowrap is still restricted to that thread. Behavior when NO_MAIN_THREAD_WRAPPING is defined is also unchanged. Also makes the ThreadManager a singleton, with private constructor and destructor. And marks its destructor as RTC_NOTREACHED, since by the documentation for RTC_DEFINE_STATIC_LOCAL, the intention is to leak the object and never destruct it. BUG=webrtc:7501 Review-Url: https://codereview.webrtc.org/2833993003 Cr-Commit-Position: refs/heads/master@{#17879} Committed: https://chromium.googlesource.com/external/webrtc/+/7866cfe575e85978dba50b1c4a1877a325601fe1

Patch Set 1 #

Total comments: 5

Patch Set 2 : Make ThreadManager's constructor and destructor private. #

Patch Set 3 : Fix Thread::IsCurrent to avoid autowrap of calling thread. #

Patch Set 4 : Rebased. #

Patch Set 5 : Limit autowrap to main thread only. New method ThreadManager::IsMainThread. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -33 lines) Patch
M webrtc/base/thread.h View 1 2 3 4 5 chunks +11 lines, -6 lines 0 comments Download
M webrtc/base/thread.cc View 1 2 3 4 4 chunks +27 lines, -17 lines 0 comments Download
M webrtc/base/thread_darwin.mm View 1 2 3 4 1 chunk +1 line, -10 lines 0 comments Download

Messages

Total messages: 32 (14 generated)
nisse-webrtc
Hi, please take a look. Taylor suggested I try out this approach, as an alternative ...
3 years, 8 months ago (2017-04-21 07:56:57 UTC) #2
tommi
On 2017/04/21 07:56:57, nisse-webrtc wrote: > Hi, please take a look. Taylor suggested I try ...
3 years, 8 months ago (2017-04-21 09:38:53 UTC) #3
tommi
lgtm https://codereview.webrtc.org/2833993003/diff/1/webrtc/base/thread.cc File webrtc/base/thread.cc (right): https://codereview.webrtc.org/2833993003/diff/1/webrtc/base/thread.cc#newcode30 webrtc/base/thread.cc:30: RTC_DEFINE_STATIC_LOCAL(ThreadManager, thread_manager, ()); I hadn't seen this macro ...
3 years, 8 months ago (2017-04-21 09:38:58 UTC) #4
Taylor Brandstetter
lgtm with some minor comments. Before this change if "Thread::Current()->Post" (for example) is called on ...
3 years, 8 months ago (2017-04-21 09:54:28 UTC) #5
nisse-webrtc
On 2017/04/21 09:38:53, tommi (wëbrtc) wrote: > On 2017/04/21 07:56:57, nisse-webrtc wrote: > > Hi, ...
3 years, 8 months ago (2017-04-21 11:05:43 UTC) #6
nisse-webrtc
https://codereview.webrtc.org/2833993003/diff/1/webrtc/base/thread.cc File webrtc/base/thread.cc (right): https://codereview.webrtc.org/2833993003/diff/1/webrtc/base/thread.cc#newcode30 webrtc/base/thread.cc:30: RTC_DEFINE_STATIC_LOCAL(ThreadManager, thread_manager, ()); On 2017/04/21 09:38:58, tommi (wëbrtc) wrote: ...
3 years, 8 months ago (2017-04-21 11:06:07 UTC) #7
Taylor Brandstetter
https://codereview.webrtc.org/2833993003/diff/1/webrtc/base/thread.cc File webrtc/base/thread.cc (right): https://codereview.webrtc.org/2833993003/diff/1/webrtc/base/thread.cc#newcode36 webrtc/base/thread.cc:36: RTC_NOTREACHED() << "ThreadManager should never be destructed."; On 2017/04/21 ...
3 years, 8 months ago (2017-04-21 11:32:54 UTC) #8
tommi
On 2017/04/21 11:32:54, Taylor Brandstetter wrote: > https://codereview.webrtc.org/2833993003/diff/1/webrtc/base/thread.cc > File webrtc/base/thread.cc (right): > > https://codereview.webrtc.org/2833993003/diff/1/webrtc/base/thread.cc#newcode36 ...
3 years, 8 months ago (2017-04-21 11:36:48 UTC) #9
nisse-webrtc
It seems peerconnection_unittest hangs (when running locally, and on the internal bit). It seems it ...
3 years, 8 months ago (2017-04-21 14:13:05 UTC) #14
nisse-webrtc
On 2017/04/21 14:13:05, nisse-webrtc wrote: > It seems peerconnection_unittest hangs (when running locally, and on ...
3 years, 8 months ago (2017-04-24 08:36:58 UTC) #15
tommi
On 2017/04/24 08:36:58, nisse-webrtc wrote: > On 2017/04/21 14:13:05, nisse-webrtc wrote: > > It seems ...
3 years, 8 months ago (2017-04-24 09:55:05 UTC) #16
nisse-webrtc
On 2017/04/24 09:55:05, tommi (wëbrtc) wrote: > Can we add a DCHECK that we never ...
3 years, 8 months ago (2017-04-24 10:53:09 UTC) #17
Taylor Brandstetter
How about just doing something to ensure only the "main thread" gets wrapped, which was ...
3 years, 8 months ago (2017-04-24 21:46:08 UTC) #18
nisse-webrtc
On 2017/04/24 21:46:08, Taylor Brandstetter wrote: > How about just doing something to ensure only ...
3 years, 8 months ago (2017-04-25 07:51:17 UTC) #19
Taylor Brandstetter
lgtm. I'd suggest making it clear in the CL description that this CL makes ThreadManager ...
3 years, 8 months ago (2017-04-25 18:44:23 UTC) #20
nisse-webrtc
On 2017/04/25 18:44:23, Taylor Brandstetter wrote: > lgtm. I'd suggest making it clear in the ...
3 years, 8 months ago (2017-04-26 07:18:32 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2833993003/80001
3 years, 8 months ago (2017-04-26 08:30:29 UTC) #29
commit-bot: I haz the power
3 years, 8 months ago (2017-04-26 08:45:36 UTC) #32
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/external/webrtc/+/7866cfe575e85978dba50b1c4...

Powered by Google App Engine
This is Rietveld 408576698