Bill commented on a change in pull request #5666:
URL: https://github.com/apache/geode/pull/5666#discussion_r514581552



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java
##########
@@ -368,17 +365,15 @@ public void doneReadingDirectAck(ByteBuffer 
unwrappedBuffer) {
     // read-operations
   }
 
-  @Override
-  public synchronized boolean isClosed() {
-    return closed;
-  }
-
   @Override
   public synchronized void close(SocketChannel socketChannel) {

Review comment:
       The `close()` method is a critical section. And after a thread has 
exited that critical section, the next thread entering it will skip all the 
actual close logic.
   
   There is no possible interference between the close logic and e.g. `wrap()`, 
specifically in their use of the output buffer a.k.a. `myNetData` (the 
`ByteBuffer` managed by `outputSharing`) because both `wrap()` and `close()` 
acquire a reference to that buffer via `ByteBufferSharingImpl.open()` and 
`ByteBufferSharingImpl.open(long time, TimeUnit unit)` respectively. Those 
methods call `lock()`/`tryLock(long time, TimeUnit unit)` on the 
`ReentrantLock` before returning.
   
   Does that help?




----------------------------------------------------------------
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]


Reply via email to