mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8019833: Wrong JNI error code for preexisting JVM
Return the appropriate JNI error message (instead of the generic one) when the JVM is already started Reviewed-by: coleenp, hseigel
This commit is contained in:
parent
4ecee47075
commit
eeba729b55
1 changed files with 1 additions and 1 deletions
|
@ -5097,7 +5097,7 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, v
|
|||
// function used to determine this will always return false. Atomic::xchg
|
||||
// does not have this problem.
|
||||
if (Atomic::xchg(1, &vm_created) == 1) {
|
||||
return JNI_ERR; // already created, or create attempt in progress
|
||||
return JNI_EEXIST; // already created, or create attempt in progress
|
||||
}
|
||||
if (Atomic::xchg(0, &safe_to_recreate_vm) == 0) {
|
||||
return JNI_ERR; // someone tried and failed and retry not allowed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue