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

Issue 12530005: Don't use magic statics in SincResampler for thread safe init. (Closed)

Created:
7 years, 9 months ago by DaleCurtis
Modified:
7 years, 9 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Don't use magic statics in SincResampler for thread safe init. SincResampler uses magic statics for thread safe initialization of runtime detected SIMD support functions. Sadly, this is not supported on MSVC++ until VS2012. Crash reports seem to indicate that every once in a while this fails on Windows and kConvolveProc ends up initialized to NULL. This patch moves initializtion from once per renderer to once per SincResampler construction. Not ideal, but there should never be very many instantiations of this class. Long term we'll be moving to an SSE baseline which obviates the runtime selection process. BUG=179986 TEST=media_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=187732

Patch Set 1 #

Total comments: 4

Patch Set 2 : Remove typedef types. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -32 lines) Patch
M media/base/sinc_resampler.h View 1 2 chunks +7 lines, -2 lines 0 comments Download
M media/base/sinc_resampler.cc View 5 chunks +27 lines, -30 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
DaleCurtis
If this fixes the crash I'll make a fix for VectorMath as well -- which ...
7 years, 9 months ago (2013-03-08 02:10:14 UTC) #1
scherkus (not reviewing)
https://codereview.chromium.org/12530005/diff/1/media/base/sinc_resampler.cc File media/base/sinc_resampler.cc (right): https://codereview.chromium.org/12530005/diff/1/media/base/sinc_resampler.cc#newcode143 media/base/sinc_resampler.cc:143: #if defined(ARCH_CPU_X86_FAMILY) how about moving all of this inside ...
7 years, 9 months ago (2013-03-08 02:33:07 UTC) #2
DaleCurtis
The original race occurs because the code boils down to: static = NULL; bool have_set_static ...
7 years, 9 months ago (2013-03-12 00:28:28 UTC) #3
DaleCurtis
I forgot: Another solution would be to just do what we do in YUVConvert: static ...
7 years, 9 months ago (2013-03-12 00:29:20 UTC) #4
scherkus (not reviewing)
lgtm
7 years, 9 months ago (2013-03-12 18:55:58 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/12530005/7001
7 years, 9 months ago (2013-03-12 20:13:03 UTC) #6
commit-bot: I haz the power
7 years, 9 months ago (2013-03-13 01:17:28 UTC) #7
Message was sent while issue was closed.
Change committed as 187732

Powered by Google App Engine
This is Rietveld 408576698