< prev index next >

src/share/vm/prims/jvmtiEnvBase.cpp

Print this page




  78 
  79   // register extension functions and events
  80   JvmtiExtensions::register_extensions();
  81 
  82 #ifdef JVMTI_TRACE
  83   JvmtiTrace::initialize();
  84 #endif
  85 
  86   _globally_initialized = true;
  87 }
  88 
  89 
  90 void
  91 JvmtiEnvBase::initialize() {
  92   assert(Threads::number_of_threads() == 0 || JvmtiThreadState_lock->is_locked(), "sanity check");
  93 
  94   // Add this environment to the end of the environment list (order is important)
  95   {
  96     // This block of code must not contain any safepoints, as list deallocation
  97     // (which occurs at a safepoint) cannot occur simultaneously with this list
  98     // addition.  Note: No_Safepoint_Verifier cannot, currently, be used before
  99     // threads exist.
 100     JvmtiEnvIterator it;
 101     JvmtiEnvBase *previous_env = NULL;
 102     for (JvmtiEnvBase* env = it.first(); env != NULL; env = it.next(env)) {
 103       previous_env = env;
 104     }
 105     if (previous_env == NULL) {
 106       _head_environment = this;
 107     } else {
 108       previous_env->set_next_environment(this);
 109     }
 110   }
 111 
 112   if (_globally_initialized == false) {
 113     globally_initialize();
 114   }
 115 }
 116 
 117 
 118 bool




  78 
  79   // register extension functions and events
  80   JvmtiExtensions::register_extensions();
  81 
  82 #ifdef JVMTI_TRACE
  83   JvmtiTrace::initialize();
  84 #endif
  85 
  86   _globally_initialized = true;
  87 }
  88 
  89 
  90 void
  91 JvmtiEnvBase::initialize() {
  92   assert(Threads::number_of_threads() == 0 || JvmtiThreadState_lock->is_locked(), "sanity check");
  93 
  94   // Add this environment to the end of the environment list (order is important)
  95   {
  96     // This block of code must not contain any safepoints, as list deallocation
  97     // (which occurs at a safepoint) cannot occur simultaneously with this list
  98     // addition.  Note: NoSafepointVerifier cannot, currently, be used before
  99     // threads exist.
 100     JvmtiEnvIterator it;
 101     JvmtiEnvBase *previous_env = NULL;
 102     for (JvmtiEnvBase* env = it.first(); env != NULL; env = it.next(env)) {
 103       previous_env = env;
 104     }
 105     if (previous_env == NULL) {
 106       _head_environment = this;
 107     } else {
 108       previous_env->set_next_environment(this);
 109     }
 110   }
 111 
 112   if (_globally_initialized == false) {
 113     globally_initialize();
 114   }
 115 }
 116 
 117 
 118 bool


< prev index next >