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

Issue 1490113004: Replaced the custom thread synchronization with rtc::Event (Closed)

Created:
5 years ago by peah-webrtc
Modified:
5 years ago
CC:
webrtc-reviews_webrtc.org, Andrew MacDonald, tterriberry_mozilla.com, audio-team_agora.io, hlundin-webrtc, kwiberg-webrtc, minyue-webrtc, the sun, aluebs-webrtc, bjornv1
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Rewrote the thread synchronization parts of the test for the locking in APM in response to a locking problem when running in a single-threaded manner. To try to resolve the problem I replaced the custom synchronization with rtc::Event which made the code cleaner, faster, and less error prone. However, in the end the source of the test locks was that during TearDown one of the threads was stuck in a waiting loop. I added a fix for the TearDown issue but still decided to keep the rtc:Event - based code change metioned above as that gave a more clean code. BUG= Committed: https://crrev.com/631e1345512c592eaebe19d9adeade6ee778624c Cr-Commit-Position: refs/heads/master@{#10880}

Patch Set 1 #

Patch Set 2 : Added proper test termination #

Total comments: 14

Patch Set 3 : Changed event pointers to be passed during construction, added a new framecounter difference functi… #

Total comments: 16

Patch Set 4 : Added const specifiers and refactored the infinite waits in the threads #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -85 lines) Patch
M webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc View 1 2 3 16 chunks +87 lines, -85 lines 7 comments Download

Messages

Total messages: 25 (9 generated)
peah-webrtc
5 years ago (2015-12-02 11:47:01 UTC) #4
pbos-webrtc
https://codereview.webrtc.org/1490113004/diff/20001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc File webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc (right): https://codereview.webrtc.org/1490113004/diff/20001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc#newcode380 webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc:380: rtc::Event& get_render_call_event() { return render_call_event_; } remove get_ prefix ...
5 years ago (2015-12-02 13:01:13 UTC) #5
hlundin-webrtc
lgtm with pbos's comments.
5 years ago (2015-12-02 14:38:30 UTC) #6
peah-webrtc
Thanks for the comments! I have added the proposed changes. On top of that, I ...
5 years ago (2015-12-02 15:02:28 UTC) #7
pbos-webrtc
PTAL https://codereview.webrtc.org/1490113004/diff/40001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc File webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc (right): https://codereview.webrtc.org/1490113004/diff/40001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc#newcode330 webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc:330: rtc::Event* render_call_event_; * const https://codereview.webrtc.org/1490113004/diff/40001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc#newcode331 webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc:331: rtc::Event* capture_call_event_; ...
5 years ago (2015-12-02 15:33:13 UTC) #8
peah-webrtc
Thanks for the comments and feedback! -I added the const specifiers. -I also refactored the ...
5 years ago (2015-12-02 22:44:41 UTC) #9
pbos-webrtc
lgtm with a question and nit https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc File webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc (right): https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc#newcode444 webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc:444: mutable RandomGenerator rand_gen_; ...
5 years ago (2015-12-02 22:59:13 UTC) #10
pbos-webrtc
On 2015/12/02 22:59:13, pbos-webrtc wrote: > lgtm with a question and nit > > https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc ...
5 years ago (2015-12-02 22:59:49 UTC) #11
peah-webrtc
On 2015/12/02 22:59:49, pbos-webrtc wrote: > On 2015/12/02 22:59:13, pbos-webrtc wrote: > > lgtm with ...
5 years ago (2015-12-03 08:12:24 UTC) #12
peah-webrtc
https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc File webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc (right): https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc#newcode444 webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc:444: mutable RandomGenerator rand_gen_; On 2015/12/02 22:59:13, pbos-webrtc wrote: > ...
5 years ago (2015-12-03 08:17:17 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1490113004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1490113004/60001
5 years ago (2015-12-03 08:17:34 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years ago (2015-12-03 09:15:31 UTC) #18
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/631e1345512c592eaebe19d9adeade6ee778624c Cr-Commit-Position: refs/heads/master@{#10880}
5 years ago (2015-12-03 09:15:45 UTC) #20
terelius
https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc File webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc (right): https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc#newcode444 webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc:444: mutable RandomGenerator rand_gen_; On 2015/12/03 08:17:17, peah-webrtc wrote: > ...
5 years ago (2015-12-09 17:10:38 UTC) #22
terelius
https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc File webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc (right): https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc#newcode444 webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc:444: mutable RandomGenerator rand_gen_; On 2015/12/09 17:10:38, terelius wrote: > ...
5 years ago (2015-12-09 17:15:07 UTC) #23
the sun
5 years ago (2015-12-10 09:37:54 UTC) #25
Message was sent while issue was closed.
https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_proc...
File webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc
(right):

https://codereview.webrtc.org/1490113004/diff/60001/webrtc/modules/audio_proc...
webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc:444:
mutable RandomGenerator rand_gen_;
On 2015/12/03 08:17:17, peah-webrtc wrote:
> On 2015/12/02 22:59:13, pbos-webrtc wrote:
> > This one looks shared between multiple instances, is it thread safe?
> It is, there us a custom class RandomGenerator which adds a lock around a
> test::Random random generator for this particular reason.

Why share the PRNG? Why not just keep separate instances (with different seeds)
in the different helper classes?

Powered by Google App Engine
This is Rietveld 408576698