File tree 8 files changed +64
-11
lines changed
jdk.sctp/unix/classes/sun/nio/ch/sctp
8 files changed +64
-11
lines changed Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
@@ -1165,13 +1171,13 @@ protected void implCloseSelectableChannel() throws IOException {
1165
1171
long reader = readerThread ;
1166
1172
long writer = writerThread ;
1167
1173
if (reader != 0 || writer != 0 ) {
1168
- nd .preClose (fd );
1169
-
1170
1174
if (reader != 0 )
1171
1175
NativeThread .signal (reader );
1172
1176
if (writer != 0 )
1173
1177
NativeThread .signal (writer );
1174
1178
1179
+ nd .preClose (fd );
1180
+
1175
1181
// wait for blocking I/O operations to end
1176
1182
while (readerThread != 0 || writerThread != 0 ) {
1177
1183
try {
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
@@ -361,9 +367,10 @@ protected void implCloseSelectableChannel() throws IOException {
361
367
assert state == ST_CLOSING ;
362
368
long th = thread ;
363
369
if (th != 0 ) {
364
- nd .preClose (fd );
365
370
NativeThread .signal (th );
366
371
372
+ nd .preClose (fd );
373
+
367
374
// wait for accept operation to end
368
375
while (thread != 0 ) {
369
376
try {
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
@@ -835,14 +841,15 @@ protected void implCloseSelectableChannel() throws IOException {
835
841
long reader = readerThread ;
836
842
long writer = writerThread ;
837
843
if (reader != 0 || writer != 0 ) {
838
- nd .preClose (fd );
839
- connected = false ; // fd is no longer connected socket
840
844
841
845
if (reader != 0 )
842
846
NativeThread .signal (reader );
843
847
if (writer != 0 )
844
848
NativeThread .signal (writer );
845
849
850
+ nd .preClose (fd );
851
+ connected = false ; // fd is no longer connected socket
852
+
846
853
// wait for blocking I/O operations to end
847
854
while (readerThread != 0 || writerThread != 0 ) {
848
855
try {
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
@@ -107,8 +113,8 @@ protected void implCloseSelectableChannel() throws IOException {
107
113
assert state == ST_CLOSING ;
108
114
long th = thread ;
109
115
if (th != 0 ) {
110
- nd .preClose (fd );
111
116
NativeThread .signal (th );
117
+ nd .preClose (fd );
112
118
113
119
// wait for write operation to end
114
120
while (thread != 0 ) {
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
29
+ * ===========================================================================
30
+ */
26
31
package sun .nio .ch ;
27
32
28
33
import java .io .FileDescriptor ;
@@ -107,8 +112,8 @@ protected void implCloseSelectableChannel() throws IOException {
107
112
assert state == ST_CLOSING ;
108
113
long th = thread ;
109
114
if (th != 0 ) {
110
- nd .preClose (fd );
111
115
NativeThread .signal (th );
116
+ nd .preClose (fd );
112
117
113
118
// wait for read operation to end
114
119
while (thread != 0 ) {
Original file line number Diff line number Diff line change 22
22
* or visit www.oracle.com if you need additional information or have any
23
23
* questions.
24
24
*/
25
+
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
25
32
package sun .nio .ch .sctp ;
26
33
27
34
import java .net .InetAddress ;
@@ -561,7 +568,6 @@ protected void implConfigureBlocking(boolean block) throws IOException {
561
568
@ Override
562
569
public void implCloseSelectableChannel () throws IOException {
563
570
synchronized (stateLock ) {
564
- SctpNet .preClose (fdVal );
565
571
566
572
if (receiverThread != 0 )
567
573
NativeThread .signal (receiverThread );
@@ -571,6 +577,8 @@ public void implCloseSelectableChannel() throws IOException {
571
577
572
578
if (!isRegistered ())
573
579
kill ();
580
+
581
+ SctpNet .preClose (fdVal );
574
582
}
575
583
}
576
584
Original file line number Diff line number Diff line change 22
22
* or visit www.oracle.com if you need additional information or have any
23
23
* questions.
24
24
*/
25
+
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
25
32
package sun .nio .ch .sctp ;
26
33
27
34
import java .net .InetAddress ;
@@ -288,8 +295,6 @@ protected void implConfigureBlocking(boolean block) throws IOException {
288
295
@ Override
289
296
public void implCloseSelectableChannel () throws IOException {
290
297
synchronized (stateLock ) {
291
- SctpNet .preClose (fdVal );
292
-
293
298
if (receiverThread != 0 )
294
299
NativeThread .signal (receiverThread );
295
300
@@ -298,6 +303,8 @@ public void implCloseSelectableChannel() throws IOException {
298
303
299
304
if (!isRegistered ())
300
305
kill ();
306
+
307
+ SctpNet .preClose (fdVal );
301
308
}
302
309
}
303
310
Original file line number Diff line number Diff line change 22
22
* or visit www.oracle.com if you need additional information or have any
23
23
* questions.
24
24
*/
25
+
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
25
32
package sun .nio .ch .sctp ;
26
33
27
34
import java .net .SocketAddress ;
@@ -265,11 +272,11 @@ protected void implConfigureBlocking(boolean block) throws IOException {
265
272
@ Override
266
273
public void implCloseSelectableChannel () throws IOException {
267
274
synchronized (stateLock ) {
268
- SctpNet .preClose (fdVal );
269
275
if (thread != 0 )
270
276
NativeThread .signal (thread );
271
277
if (!isRegistered ())
272
278
kill ();
279
+ SctpNet .preClose (fdVal );
273
280
}
274
281
}
275
282
You can’t perform that action at this time.
0 commit comments