Hi Xuelei,
I believe there is still a small window of opportunity
for which `readLockedDeplete();` will never be called.
The issue is in `deplete()`:
If tryLock() fails to lock at line
1046 if (readLock.tryLock()) {
then there's no guarantee that the reading
thread will not release the readLock before
the else { } statement is executed at line:
1054 isClosing = true;
Thread 1: enters `read`, locks `readLock`
Thread 2: enters `deplete`, fails to lock
Thread 1: finishes reading, find `isClosing` is false,
releases `readLock`.
Thread 2: `deplete` sets `isClosing` to true and returns
then any further call to `read` will find `isClosing == true`
and return EOF.
If that happens and I'm not mistaken, then
`readLockedDeplete();` will never be called.
best regards,
-- daniel
On 02/05/2019 21:11, Xuelei Fan wrote:
Hi,
Could I get the following update reviewed?
http://cr.openjdk.java.net/~xuelei/8219991/webrev.00/
The March5 test looks good, and the external test described in
JDK-8219658 passed. No new regression test.
Thanks,
Xuelei