@@ -315,7 +315,7 @@ public long getLastAccessedTime() {
315315 /**
316316 * Invalidate this session
317317 */
318- public void invalidate () {
318+ public synchronized void invalidate () {
319319 this .valid = false ;
320320 }
321321
@@ -324,7 +324,7 @@ public void invalidate() {
324324 *
325325 * @return boolean if this session is valid
326326 */
327- public boolean isValid () {
327+ public synchronized boolean isValid () {
328328 return this .valid ;
329329 }
330330
@@ -333,7 +333,7 @@ public boolean isValid() {
333333 * session is then valid and can be joined or resumed
334334 * @param in true/false valid boolean
335335 */
336- protected void setValid (boolean in ) {
336+ protected synchronized void setValid (boolean in ) {
337337 this .valid = in ;
338338 }
339339
@@ -836,7 +836,7 @@ public String[] getPeerSupportedSignatureAlgorithms() {
836836 * if no SNI names were requested.
837837 */
838838 @ Override
839- public List <SNIServerName > getRequestedServerNames ()
839+ public synchronized List <SNIServerName > getRequestedServerNames ()
840840 throws UnsupportedOperationException {
841841
842842 byte [] sniRequestArr = null ;
@@ -863,7 +863,7 @@ public List<SNIServerName> getRequestedServerNames()
863863
864864 @ SuppressWarnings ("deprecation" )
865865 @ Override
866- protected void finalize () throws Throwable
866+ protected synchronized void finalize () throws Throwable
867867 {
868868 WolfSSLDebug .log (getClass (), WolfSSLDebug .INFO ,
869869 "entered finalize(): this.sesPtr = " + this .sesPtr );
0 commit comments