Commit 6bd4ba6d authored by Lubomir Bulej's avatar Lubomir Bulej
Browse files

Keep JVM state flags local to disl.c

parent 07e9efa1
......@@ -18,6 +18,20 @@
static const struct config * agent_config;
/*
* Flag indicating that the VM has been started, which
* allows calling any JNI function.
*/
static volatile bool jvm_is_started;
/*
* Flag indicating that the VM has been initialized,
* which allows calling any JNI or JVMTI function.
*/
static volatile bool jvm_is_initialized;
/*
* Register the jvmti capabilities needed by disl instrumentation agent.
*
......@@ -161,6 +175,9 @@ send_instrumentation (const struct config * agent_config) {
void
disl_init (const struct config * config, jvmtiEnv * jvmti) {
jvm_is_started = false;
jvm_is_initialized = false;
agent_config = config;
agent_code_flags = calc_code_flags (config, true);
......
......@@ -12,18 +12,6 @@
#include "../config.h"
/*
* Flag indicating that the VM has been started, which
* allows calling any JNI function.
*/
static volatile bool jvm_is_started;
/*
* Flag indicating that the VM has been initialized,
* which allows calling any JNI or JVMTI function.
*/
static volatile bool jvm_is_initialized;
/*
* Flags representing code options, derived from the values generated from Java.
*/
......
......@@ -257,9 +257,6 @@ Agent_OnLoad (JavaVM * jvm, char * options, void * reserved) {
jvmti_enable_events (jvmti, shvm_events, sizeof_array (shvm_events));
}
jvm_is_started = false;
jvm_is_initialized = false;
// Init thread local storage.
tls_init ();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment