hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp
changeset 37129 af29e306e50b
parent 37125 188d715655a3
child 37134 9dd3975ca940
equal deleted inserted replaced
37128:ea9e0371b8e6 37129:af29e306e50b
    38 #include "runtime/vmThread.hpp"
    38 #include "runtime/vmThread.hpp"
    39 
    39 
    40 // ======= Concurrent Mark Thread ========
    40 // ======= Concurrent Mark Thread ========
    41 
    41 
    42 // The CM thread is created when the G1 garbage collector is used
    42 // The CM thread is created when the G1 garbage collector is used
    43 
       
    44 SurrogateLockerThread*
       
    45      ConcurrentMarkThread::_slt = NULL;
       
    46 
    43 
    47 ConcurrentMarkThread::ConcurrentMarkThread(G1ConcurrentMark* cm) :
    44 ConcurrentMarkThread::ConcurrentMarkThread(G1ConcurrentMark* cm) :
    48   ConcurrentGCThread(),
    45   ConcurrentGCThread(),
    49   _cm(cm),
    46   _cm(cm),
    50   _state(Idle),
    47   _state(Idle),
   303 
   300 
   304   if (started()) {
   301   if (started()) {
   305     set_in_progress();
   302     set_in_progress();
   306   }
   303   }
   307 }
   304 }
   308 
       
   309 // Note: As is the case with CMS - this method, although exported
       
   310 // by the ConcurrentMarkThread, which is a non-JavaThread, can only
       
   311 // be called by a JavaThread. Currently this is done at vm creation
       
   312 // time (post-vm-init) by the main/Primordial (Java)Thread.
       
   313 // XXX Consider changing this in the future to allow the CM thread
       
   314 // itself to create this thread?
       
   315 void ConcurrentMarkThread::makeSurrogateLockerThread(TRAPS) {
       
   316   assert(UseG1GC, "SLT thread needed only for concurrent GC");
       
   317   assert(THREAD->is_Java_thread(), "must be a Java thread");
       
   318   assert(_slt == NULL, "SLT already created");
       
   319   _slt = SurrogateLockerThread::make(THREAD);
       
   320 }