Bug 224543 - AudioSourceProviderAVFObjC uses atomic variables but also locks with mutex
Summary: AudioSourceProviderAVFObjC uses atomic variables but also locks with mutex
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kimmo Kinnunen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-14 05:58 PDT by Kimmo Kinnunen
Modified: 2021-04-23 02:52 PDT (History)
9 users (show)

See Also:


Attachments
Patch (4.73 KB, patch)
2021-04-14 06:00 PDT, Kimmo Kinnunen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2021-04-14 05:58:35 PDT
AudioSourceProviderAVFObjC uses atomic variables but also locks with mutex
This makes it hard to understand the code, as the atomic usage seems to be purposeless.
Comment 1 Kimmo Kinnunen 2021-04-14 06:00:49 PDT
Created attachment 425975 [details]
Patch
Comment 2 Alexey Proskuryakov 2021-04-15 15:45:27 PDT
Comment on attachment 425975 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425975&action=review

> Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:378
> +        m_writeAheadCount = m_tapDescription->mSampleRate * earlyBy.toDouble();

I looked here as an example, and I don't see any mutex serializing the access.
Comment 3 Kimmo Kinnunen 2021-04-15 22:14:47 PDT
Comment on attachment 425975 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425975&action=review

>> Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:378
>> +        m_writeAheadCount = m_tapDescription->mSampleRate * earlyBy.toDouble();
> 
> I looked here as an example, and I don't see any mutex serializing the access.

Taken up there in the caller, processCallback.
Comment 4 EWS 2021-04-20 04:38:45 PDT
Committed r276301 (236783@main): <https://commits.webkit.org/236783@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425975 [details].
Comment 5 Ling Ho 2021-04-23 02:52:02 PDT
rdar://76893260