src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
changeset 50933 76b5ee99ffc0
parent 50722 bc104aaf24e9
child 53018 8bf9268df0e2
equal deleted inserted replaced
50932:6d03b1ea636b 50933:76b5ee99ffc0
     1 /*
     1 /*
     2  * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   271             }
   271             }
   272         }
   272         }
   273 
   273 
   274         // invoke handler and set result
   274         // invoke handler and set result
   275         CompletionHandler<Void,Object> handler = connectHandler;
   275         CompletionHandler<Void,Object> handler = connectHandler;
       
   276         connectHandler = null;
   276         Object att = connectAttachment;
   277         Object att = connectAttachment;
   277         PendingFuture<Void,Object> future = connectFuture;
   278         PendingFuture<Void,Object> future = connectFuture;
   278         if (handler == null) {
   279         if (handler == null) {
   279             future.setResult(null, e);
   280             future.setResult(null, e);
   280         } else {
   281         } else {
   403 
   404 
   404             // allow objects to be GC'ed.
   405             // allow objects to be GC'ed.
   405             this.readBuffer = null;
   406             this.readBuffer = null;
   406             this.readBuffers = null;
   407             this.readBuffers = null;
   407             this.readAttachment = null;
   408             this.readAttachment = null;
       
   409             this.readHandler = null;
   408 
   410 
   409             // allow another read to be initiated
   411             // allow another read to be initiated
   410             enableReading();
   412             enableReading();
   411 
   413 
   412         } catch (Throwable x) {
   414         } catch (Throwable x) {
   598 
   600 
   599             // allow objects to be GC'ed.
   601             // allow objects to be GC'ed.
   600             this.writeBuffer = null;
   602             this.writeBuffer = null;
   601             this.writeBuffers = null;
   603             this.writeBuffers = null;
   602             this.writeAttachment = null;
   604             this.writeAttachment = null;
       
   605             this.writeHandler = null;
   603 
   606 
   604             // allow another write to be initiated
   607             // allow another write to be initiated
   605             enableWriting();
   608             enableWriting();
   606 
   609 
   607         } catch (Throwable x) {
   610         } catch (Throwable x) {