< prev index next >

src/share/vm/gc_implementation/shared/concurrentGCThread.cpp

Print this page
rev 7267 : 8062036: ConcurrentMarkThread::slt may be invoked before ConcurrentMarkThread::makeSurrogateLockerThread causing intermittent crashes
Summary: Suppress gc_alot during VM init, improve error for SLT uninitialized.
Reviewed-by: jmasa, brutisso


 123     // in that case. However, since this must work and we do not allow
 124     // exceptions anyway, check and abort if this fails.
 125     if (res == NULL || res->osthread() == NULL) {
 126       vm_exit_during_initialization("java.lang.OutOfMemoryError",
 127                                     os::native_thread_creation_failed_msg());
 128     }
 129     java_lang_Thread::set_thread(thread_oop(), res);
 130     java_lang_Thread::set_priority(thread_oop(), NearMaxPriority);
 131     java_lang_Thread::set_daemon(thread_oop());
 132 
 133     res->set_threadObj(thread_oop());
 134     Threads::add(res);
 135     Thread::start(res);
 136   }
 137   os::naked_yield(); // This seems to help with initial start-up of SLT
 138   return res;
 139 }
 140 
 141 void SurrogateLockerThread::report_missing_slt() {
 142   vm_exit_during_initialization(
 143     "GC before GC support fully initialized: SLT not yet created");

 144   ShouldNotReachHere();
 145 }
 146 
 147 void SurrogateLockerThread::manipulatePLL(SLT_msg_type msg) {
 148   MutexLockerEx x(&_monitor, Mutex::_no_safepoint_check_flag);
 149   assert(_buffer == empty, "Should be empty");
 150   assert(msg != empty, "empty message");
 151   assert(!Heap_lock->owned_by_self(), "Heap_lock owned by requesting thread");
 152 
 153   _buffer = msg;
 154   while (_buffer != empty) {
 155     _monitor.notify();
 156     _monitor.wait(Mutex::_no_safepoint_check_flag);
 157   }
 158 }
 159 
 160 // ======= Surrogate Locker Thread =============
 161 
 162 void SurrogateLockerThread::loop() {
 163   BasicLock pll_basic_lock;




 123     // in that case. However, since this must work and we do not allow
 124     // exceptions anyway, check and abort if this fails.
 125     if (res == NULL || res->osthread() == NULL) {
 126       vm_exit_during_initialization("java.lang.OutOfMemoryError",
 127                                     os::native_thread_creation_failed_msg());
 128     }
 129     java_lang_Thread::set_thread(thread_oop(), res);
 130     java_lang_Thread::set_priority(thread_oop(), NearMaxPriority);
 131     java_lang_Thread::set_daemon(thread_oop());
 132 
 133     res->set_threadObj(thread_oop());
 134     Threads::add(res);
 135     Thread::start(res);
 136   }
 137   os::naked_yield(); // This seems to help with initial start-up of SLT
 138   return res;
 139 }
 140 
 141 void SurrogateLockerThread::report_missing_slt() {
 142   vm_exit_during_initialization(
 143     "GC before GC support fully initialized: "
 144     "SLT is needed but has not yet been created.");
 145   ShouldNotReachHere();
 146 }
 147 
 148 void SurrogateLockerThread::manipulatePLL(SLT_msg_type msg) {
 149   MutexLockerEx x(&_monitor, Mutex::_no_safepoint_check_flag);
 150   assert(_buffer == empty, "Should be empty");
 151   assert(msg != empty, "empty message");
 152   assert(!Heap_lock->owned_by_self(), "Heap_lock owned by requesting thread");
 153 
 154   _buffer = msg;
 155   while (_buffer != empty) {
 156     _monitor.notify();
 157     _monitor.wait(Mutex::_no_safepoint_check_flag);
 158   }
 159 }
 160 
 161 // ======= Surrogate Locker Thread =============
 162 
 163 void SurrogateLockerThread::loop() {
 164   BasicLock pll_basic_lock;


< prev index next >