RFR [8024521] (process) Async close issues with Process InputStream
Martin Buchholz
martinrb at google.com
Mon Oct 28 18:10:42 UTC 2013
On Mon, Oct 28, 2013 at 2:28 AM, Alan Bateman <Alan.Bateman at oracle.com>wrote:
> On 25/10/2013 16:59, Martin Buchholz wrote:
>
>> After rebasing, I propose this change which is shorter and is more
>> obviously correct.
>>
>> I agree, this is simpler (more obvious) so it is a good clean-up. One
> additional thing may be to add a comment to explain why processExited is
> synchronized (or alternatively move the synchronization to drainInputStream
> where it is required to ensure that other threads don't read anything
> between available and read).
There's no shortage of comments in the code already, that make it clear
something tricky is going on. The locking pattern adopted here ("main"
lock + close lock) is not previously known to me. I don't see any
obviously better wording.
More information about the core-libs-dev
mailing list