• Narayan Kamath's avatar
    Tidy up locking in OpenSSLSocketImpl. · 8db22531
    Narayan Kamath authored
    We guard all state with a single lock "stateLock", which
    replaces usages of "this" and "handshakeLock". We do not
    perform any blocking operations while holding this lock.
    In particular, startHandshake is no longer synchronized.
    
    We use a single integer to keep track of handshake state
    instead of a pair of booleans.
    
    Also fix a bug in getSession, the previous implementation
    wouldn't work in cut-through mode.
    
    This fixes a deadlock in SSLSocketTest_interrupt.
    
    Change-Id: I9aef991e0579d4094e287dde8e521d09d6468c51
    8db22531
OpenSSLSocketImpl.java 53 KB