-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make readBuffered blocking and add a readBuffered with a timeout, fix… #782
Conversation
@@ -105,15 +105,15 @@ public int readBuffered(char[] b) throws IOException { | |||
b[0] = (char) ch; | |||
ch = READ_EXPIRED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Unprotected write. Non-private method NonBlockingReaderImpl.readBuffered(...)
writes to field this.ch
outside of synchronization.
Reporting because another access to the same memory occurs on a background thread, although this access may not.
(at-me in a reply with help
or ignore
)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
@@ -105,15 +105,15 @@ public int readBuffered(char[] b) throws IOException { | |||
b[0] = (char) ch; | |||
ch = READ_EXPIRED; | |||
return 1; | |||
} else if (!threadIsReading) { | |||
} else if (!threadIsReading && timeout <= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method NonBlockingReaderImpl.readBuffered(...)
reads without synchronization from this.threadIsReading
. Potentially races with write in method NonBlockingReaderImpl.read(...)
.
Reporting because another access to the same memory occurs on a background thread, although this access may not.
(at-me in a reply with help
or ignore
)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
} else if (b.length == 0) { | ||
} else if (off < 0 || len < 0 || off + len < b.length) { | ||
throw new IllegalArgumentException(); | ||
} else if (len == 0) { | ||
return 0; | ||
} else if (exception != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method NonBlockingReaderImpl.readBuffered(...)
reads without synchronization from this.exception
. Potentially races with write in method NonBlockingReaderImpl.read(...)
.
Reporting because another access to the same memory occurs on a background thread, although this access may not.
(at-me in a reply with help
or ignore
)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
@@ -105,15 +107,16 @@ public int readBuffered(char[] b) throws IOException { | |||
b[0] = (char) ch; | |||
ch = READ_EXPIRED; | |||
return 1; | |||
} else if (!threadIsReading) { | |||
return in.read(b); | |||
} else if (!threadIsReading && timeout <= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method NonBlockingReaderImpl.readBuffered(...)
reads without synchronization from this.threadIsReading
. Potentially races with write in method NonBlockingReaderImpl.read(...)
.
Reporting because another access to the same memory occurs on a background thread, although this access may not.
(at-me in a reply with help
or ignore
)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
@@ -105,15 +107,16 @@ public int readBuffered(char[] b) throws IOException { | |||
b[0] = (char) ch; | |||
ch = READ_EXPIRED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Unprotected write. Non-private method NonBlockingReaderImpl.readBuffered(...)
writes to field this.ch
outside of synchronization.
Reporting because another access to the same memory occurs on a background thread, although this access may not.
(at-me in a reply with help
or ignore
)
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
…es #757