sdedic commented on a change in pull request #2986:
URL: https://github.com/apache/netbeans/pull/2986#discussion_r645123237
##########
File path:
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbProcessConsole.java
##########
@@ -71,7 +71,18 @@ public void stop() {
protected InputStream getStdIn() throws IOException {
synchronized (this) {
if (inputSink == null) {
- inputSink = new PipedInputStream(inputSource);
+ inputSink = new PipedInputStream(inputSource) {
+ @Override
+ public void close() throws IOException {
+ synchronized(this) {
Review comment:
This way, the internal `closedByReader` flag + `closedByWriter` flag
will be set 'atomically' for the blocking reader and only then it is allowed to
run (acquires its lock). Not sure if it matters, in fact, but I wanted to have
the close 'consistent'.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists