code: private void resetSyncToOSThread(WebSecurityContext webSecurityContext) throws ThreadIdentityException {
          Object token = webSecurityContext.getSyncToOSThreadToken();
          if (token != null) {
              ThreadIdentityManager.resetChecked(token);
          }
      }
docs: Remove the invocation Subject's identity from the thread, if it was previously sync'ed.
  
  @param WebSecurityContext The security context object for this application invocation.
  MUST NOT BE NULL.
  @throws ThreadIdentityException