<Sound Dev> [10] Review Request: 8178403 DirectAudio in JavaSound may hang and leak

Anton Litvinov anton.litvinov at oracle.com
Thu Jul 6 13:10:05 UTC 2017


Hello Sergey,

The fix looks good. But I do not have a reviewer status.

Thank you,
Anton

On 05/07/2017 20:49, Phil Race wrote:
> ok. +1
>
>
> -phil.
>
> On 07/05/2017 11:06 AM, Sergey Bylokhov wrote:
>>> thread is assigned on creation and we are checking it in run() so
>>> (thread == curThread) seems like it must be true until somehow
>>> implClose() is called :
>>> So why not just check if (thread == null) instead ?
>> This is because we assign the "thread" in the open() method, not in 
>> the constructor. If the user will call open->close->open, then two 
>> threads will be created (the first thread should be stopped after the 
>> close() was called).
>>
>>> And when can oldThread will be null ? If someone called stop twice ?
>> If open() was not called.
>>
>>> And why is there no thread = null assignment in implClose() ?
>> It is there:
>> 1300        Thread oldThread = thread;
>> 1301        thread = null;
>>> Shouldn't you update the test to add this new bug id ?
>> Yes, it should:
>> http://cr.openjdk.java.net/~serb/8178403/webrev.01
>



More information about the sound-dev mailing list