Hi, Could I get the following update reviewed? http://cr.openjdk.java.net/~xuelei/8224829/webrev.00/
If using one thread for closing, one thread for writing. Closing and writing threads are synchronized in order to delivery close_notify TLS record. There are could be race between the two threads. If the output stream buffer reach the limit, the write will be blocked, and then the close thread may be pending.
The SO_LINGER is used to resolve the issue for general socket. With the above update, the SSLSocket implementation will check the SO_LINGER as well. If SO_LINGER is on, the SSLSocket close will try to get the synchronization lock in the time of SO_LINGER value. If timeout, the close process will move on, and close the underlying socket by force.
Thanks, Xuelei