Mercurial > hg > truffle
comparison src/share/vm/prims/jni.cpp @ 11089:f323bbb0e6c1
8019833: Wrong JNI error code for preexisting JVM
Summary: Return the appropriate JNI error message (instead of the generic one) when the JVM is already started
Reviewed-by: coleenp, hseigel
Contributed-by: sylvestre@debian.org
author | coleenp |
---|---|
date | Wed, 03 Jul 2013 13:45:39 -0400 |
parents | 97c5acae48be |
children | 59b052799158 |
comparison
equal
deleted
inserted
replaced
11065:cedf20e2a655 | 11089:f323bbb0e6c1 |
---|---|
5095 // the add/dec implementations are dependent on whether we are running | 5095 // the add/dec implementations are dependent on whether we are running |
5096 // on a multiprocessor, and at this stage of initialization the os::is_MP | 5096 // on a multiprocessor, and at this stage of initialization the os::is_MP |
5097 // function used to determine this will always return false. Atomic::xchg | 5097 // function used to determine this will always return false. Atomic::xchg |
5098 // does not have this problem. | 5098 // does not have this problem. |
5099 if (Atomic::xchg(1, &vm_created) == 1) { | 5099 if (Atomic::xchg(1, &vm_created) == 1) { |
5100 return JNI_ERR; // already created, or create attempt in progress | 5100 return JNI_EEXIST; // already created, or create attempt in progress |
5101 } | 5101 } |
5102 if (Atomic::xchg(0, &safe_to_recreate_vm) == 0) { | 5102 if (Atomic::xchg(0, &safe_to_recreate_vm) == 0) { |
5103 return JNI_ERR; // someone tried and failed and retry not allowed. | 5103 return JNI_ERR; // someone tried and failed and retry not allowed. |
5104 } | 5104 } |
5105 | 5105 |