src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot-rt-fx60 Sdiff src/share/vm/gc_implementation/concurrentMarkSweep

src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp

Print this page




  58 volatile bool ConcurrentMarkSweepThread::_should_stop    = true;
  59 
  60 SurrogateLockerThread*
  61      ConcurrentMarkSweepThread::_slt = NULL;
  62 SurrogateLockerThread::SLT_msg_type
  63      ConcurrentMarkSweepThread::_sltBuffer = SurrogateLockerThread::empty;
  64 Monitor*
  65      ConcurrentMarkSweepThread::_sltMonitor = NULL;
  66 
  67 ConcurrentMarkSweepThread::ConcurrentMarkSweepThread(CMSCollector* collector)
  68   : ConcurrentGCThread() {
  69   assert(UseConcMarkSweepGC,  "UseConcMarkSweepGC should be set");
  70   assert(_cmst == NULL, "CMS thread already created");
  71   _cmst = this;
  72   assert(_collector == NULL, "Collector already set");
  73   _collector = collector;
  74 
  75   set_name("Concurrent Mark-Sweep GC Thread");
  76 
  77   if (os::create_thread(this, os::cgc_thread)) {
  78     // XXX: need to set this to low priority
  79     // unless "agressive mode" set; priority
  80     // should be just less than that of VMThread.
  81     os::set_priority(this, NearMaxPriority);





  82     if (!DisableStartThread) {
  83       os::start_thread(this);
  84     }
  85   }
  86   _sltMonitor = SLT_lock;
  87   assert(!CMSIncrementalMode || icms_is_enabled(), "Error");
  88 }
  89 
  90 void ConcurrentMarkSweepThread::run() {
  91   assert(this == cmst(), "just checking");
  92 
  93   this->record_stack_base_and_size();
  94   this->initialize_thread_local_storage();
  95   this->set_active_handles(JNIHandleBlock::allocate_block());
  96   // From this time Thread::current() should be working.
  97   assert(this == Thread::current(), "just checking");
  98   if (BindCMSThreadToCPU && !os::bind_to_processor(CPUForCMSThread)) {
  99     warning("Couldn't bind CMS thread to processor %u", CPUForCMSThread);
 100   }
 101   // Wait until Universe::is_fully_initialized()




  58 volatile bool ConcurrentMarkSweepThread::_should_stop    = true;
  59 
  60 SurrogateLockerThread*
  61      ConcurrentMarkSweepThread::_slt = NULL;
  62 SurrogateLockerThread::SLT_msg_type
  63      ConcurrentMarkSweepThread::_sltBuffer = SurrogateLockerThread::empty;
  64 Monitor*
  65      ConcurrentMarkSweepThread::_sltMonitor = NULL;
  66 
  67 ConcurrentMarkSweepThread::ConcurrentMarkSweepThread(CMSCollector* collector)
  68   : ConcurrentGCThread() {
  69   assert(UseConcMarkSweepGC,  "UseConcMarkSweepGC should be set");
  70   assert(_cmst == NULL, "CMS thread already created");
  71   _cmst = this;
  72   assert(_collector == NULL, "Collector already set");
  73   _collector = collector;
  74 
  75   set_name("Concurrent Mark-Sweep GC Thread");
  76 
  77   if (os::create_thread(this, os::cgc_thread)) {
  78     // Priority should be just less than that of VMThread.
  79     int native_prio;
  80     if (UseCriticalCMSThreadPriority) {
  81       native_prio = os::java_to_os_priority[CriticalPriority];
  82     } else {
  83       native_prio = os::java_to_os_priority[NearMaxPriority];
  84     }
  85     os::set_native_priority(this, native_prio);
  86 
  87     if (!DisableStartThread) {
  88       os::start_thread(this);
  89     }
  90   }
  91   _sltMonitor = SLT_lock;
  92   assert(!CMSIncrementalMode || icms_is_enabled(), "Error");
  93 }
  94 
  95 void ConcurrentMarkSweepThread::run() {
  96   assert(this == cmst(), "just checking");
  97 
  98   this->record_stack_base_and_size();
  99   this->initialize_thread_local_storage();
 100   this->set_active_handles(JNIHandleBlock::allocate_block());
 101   // From this time Thread::current() should be working.
 102   assert(this == Thread::current(), "just checking");
 103   if (BindCMSThreadToCPU && !os::bind_to_processor(CPUForCMSThread)) {
 104     warning("Couldn't bind CMS thread to processor %u", CPUForCMSThread);
 105   }
 106   // Wait until Universe::is_fully_initialized()


src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File