Bug 67866 - HRTFDatabaseLoader should not call WTF::waitForThreadCompletion() more than once
: HRTFDatabaseLoader should not call WTF::waitForThreadCompletion() more than once
Status: RESOLVED FIXED
: WebKit
New Bugs
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2011-09-09 14:46 PST by
Modified: 2011-09-09 17:58 PST (History)


Attachments
Patch (3.80 KB, patch)
2011-09-09 14:50 PST, Chris Rogers
no flags Review Patch | Details | Formatted Diff | Diff
Patch (4.36 KB, patch)
2011-09-09 16:26 PST, Chris Rogers
no flags Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2011-09-09 14:46:44 PST
HRTFDatabaseLoader should not call WTF::waitForThreadCompletion() more than once
------- Comment #1 From 2011-09-09 14:50:14 PST -------
Created an attachment (id=106926) [details]
Patch
------- Comment #2 From 2011-09-09 15:21:33 PST -------
(From update of attachment 106926 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=106926&action=review

> Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp:127
> +    // WTF::waitForThreadCompletion() should not be called twice for the same thread.

It feels odd to have the WTF:: prefix here but not in the code. It takes me a little more time to pair the two. (I'd just leave it off in the comment.)

> Source/WebCore/platform/audio/HRTFDatabaseLoader.h:84
> +    Mutex m_threadLock;

Ideally there would be some comment like what is here: http://trac.webkit.org/browser/trunk/Source/WebCore/loader/icon/IconDatabase.h#L160

I think it is only guarding  m_databaseLoaderThread but in one instance in the code, it is also guarding "m_startedLoadingDatabase = true;" which I don't think is needed (and is confusing because that variable isn't guarded when used elsewhere.

Why do we even have m_startedLoadingDatabase when it seems like the value of m_databaseLoaderThread serves the same purpose?
------- Comment #3 From 2011-09-09 16:26:43 PST -------
Created an attachment (id=106936) [details]
Patch
------- Comment #4 From 2011-09-09 16:27:57 PST -------
(In reply to comment #2)
> (From update of attachment 106926 [details] [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=106926&action=review
> 
> > Source/WebCore/platform/audio/HRTFDatabaseLoader.cpp:127
> > +    // WTF::waitForThreadCompletion() should not be called twice for the same thread.
> 
> It feels odd to have the WTF:: prefix here but not in the code. It takes me a little more time to pair the two. (I'd just leave it off in the comment.)

FIXED

> 
> > Source/WebCore/platform/audio/HRTFDatabaseLoader.h:84
> > +    Mutex m_threadLock;
> 
> Ideally there would be some comment like what is here: http://trac.webkit.org/browser/trunk/Source/WebCore/loader/icon/IconDatabase.h#L160

FIXED: added similar comment

> 
> I think it is only guarding  m_databaseLoaderThread but in one instance in the code, it is also guarding "m_startedLoadingDatabase = true;" which I don't think is needed (and is confusing because that variable isn't guarded when used elsewhere.
> 
> Why do we even have m_startedLoadingDatabase when it seems like the value of m_databaseLoaderThread serves the same purpose?

Good point - removed m_startedLoadingDatabase
------- Comment #5 From 2011-09-09 16:29:44 PST -------
(From update of attachment 106936 [details])
Thanks!
------- Comment #6 From 2011-09-09 16:32:08 PST -------
Dave, thanks for the review.  I really appreciate you bearing through this problem with me.  Now hopefully my win-debug layout tests will greenify!
------- Comment #7 From 2011-09-09 17:58:50 PST -------
(From update of attachment 106936 [details])
Clearing flags on attachment: 106936

Committed r94893: <http://trac.webkit.org/changeset/94893>
------- Comment #8 From 2011-09-09 17:58:54 PST -------
All reviewed patches have been landed.  Closing bug.