File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11 Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2003, 2021 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2003, 2022 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -207,7 +207,12 @@ void demoteObjSession(Session session) {
207207 // will be added to correct pool on release, nothing to do now
208208 return ;
209209 }
210- opSessions .release (session );
210+ // Objects could have been added to this session by other thread between
211+ // check in Session.removeObject method and objSessions.remove call
212+ // higher. Therefore releaseSession method, which performs additional
213+ // check for objects, is used here to avoid placing this session
214+ // in wrong pool due to race condition.
215+ releaseSession (session );
211216 }
212217
213218 private Session openSession () throws PKCS11Exception {
You can’t perform that action at this time.
0 commit comments