src/hotspot/share/prims/jni.cpp
changeset 57699 4aea554692aa
parent 57570 d7304cf430f1
child 57811 947252a54b98
equal deleted inserted replaced
57698:9dc92e89243a 57699:4aea554692aa
  4133 
  4133 
  4134   thread->initialize_tlab();
  4134   thread->initialize_tlab();
  4135 
  4135 
  4136   thread->cache_global_variables();
  4136   thread->cache_global_variables();
  4137 
  4137 
  4138   // Crucial that we do not have a safepoint check for this thread, since it has
  4138   // This thread will not do a safepoint check, since it has
  4139   // not been added to the Thread list yet.
  4139   // not been added to the Thread list yet.
  4140   { Threads_lock->lock_without_safepoint_check();
  4140   { MutexLocker ml(Threads_lock);
  4141     // This must be inside this lock in order to get FullGCALot to work properly, i.e., to
  4141     // This must be inside this lock in order to get FullGCALot to work properly, i.e., to
  4142     // avoid this thread trying to do a GC before it is added to the thread-list
  4142     // avoid this thread trying to do a GC before it is added to the thread-list
  4143     thread->set_active_handles(JNIHandleBlock::allocate_block());
  4143     thread->set_active_handles(JNIHandleBlock::allocate_block());
  4144     Threads::add(thread, daemon);
  4144     Threads::add(thread, daemon);
  4145     Threads_lock->unlock();
       
  4146   }
  4145   }
  4147   // Create thread group and name info from attach arguments
  4146   // Create thread group and name info from attach arguments
  4148   oop group = NULL;
  4147   oop group = NULL;
  4149   char* thread_name = NULL;
  4148   char* thread_name = NULL;
  4150   if (args != NULL && Threads::is_supported_jni_version(args->version)) {
  4149   if (args != NULL && Threads::is_supported_jni_version(args->version)) {