Skip to content

Commit 7bf6291

Browse files
committed
Hang in PreClose method during dup2 system call
During fcntl, dup2 system calls if read/write happens then PreClose method gets hang. This issue is not seen if we Signal/Kill the thread first and then call the preClose method. Signed-off-by: Shruthi.Shruthi1 <[email protected]>
1 parent a8becd5 commit 7bf6291

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/java.base/unix/classes/sun/nio/ch/SourceChannelImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ protected void implCloseSelectableChannel() throws IOException {
107107
assert state == ST_CLOSING;
108108
long th = thread;
109109
if (th != 0) {
110-
nd.preClose(fd);
111110
NativeThread.signal(th);
111+
nd.preClose(fd);
112112

113113
// wait for read operation to end
114114
while (thread != 0) {

0 commit comments

Comments
 (0)