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 1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -207,7 +207,12 @@ void demoteObjSession(Session session) {
207
207
// will be added to correct pool on release, nothing to do now
208
208
return ;
209
209
}
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 );
211
216
}
212
217
213
218
private Session openSession () throws PKCS11Exception {
You can’t perform that action at this time.
0 commit comments