<Sound Dev> [11] Review Request: 8202264 Race condition in AudioClip.loop()

Phil Race philip.race at oracle.com
Mon Jul 9 22:44:35 UTC 2018


Looks ok.
Are you sure the test does not need to be marked as headful ?
I'm OK if you need to make that change to not send an updated webrev.

-phil.

On 07/09/2018 04:25 AM, Sergey Bylokhov wrote:
> Hello, Audio Guru.
>
> Please review the fix for jdk11.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8202264
> Webrev: http://cr.openjdk.java.net/~serb/8202264/webrev.00
>
> Our implementation of "java.applet.AudioClip" is a wrapper for 
> "javax.sound.sampled.Line", which should be closed after usage.
>
> We close the line in two situations:
>  1. When finalize() is called for the AudioClip.
>  2. When the AudioClip is inactive 5 seconds after creation(at the 
> moment of check).
>
> The second case has some issues:
>  - The clip can be closed automatically not after 5 seconds from the 
> last activity, but even if the clip is actively used but inactive 
> exactly at 5 seconds after creation.
>  - The clip can be closed automatically when(or immediately after) the 
> user will try to play some sounds.
>
> In the fix I have disabled auto-closing, when the user tries to play 
> the sounds. As a side effect we will close the clip after 5 seconds of 
> inactivity.
>
>



More information about the sound-dev mailing list