src/hotspot/share/runtime/init.cpp
changeset 59247 56bf71d64d51
parent 58048 8009a9c36251
child 59290 97d13893ec3c
equal deleted inserted replaced
59246:fcad92f425c5 59247:56bf71d64d51
   193 }
   193 }
   194 
   194 
   195 static volatile bool _init_completed = false;
   195 static volatile bool _init_completed = false;
   196 
   196 
   197 bool is_init_completed() {
   197 bool is_init_completed() {
   198   return OrderAccess::load_acquire(&_init_completed);
   198   return Atomic::load_acquire(&_init_completed);
   199 }
   199 }
   200 
   200 
   201 void wait_init_completed() {
   201 void wait_init_completed() {
   202   MonitorLocker ml(InitCompleted_lock, Monitor::_no_safepoint_check_flag);
   202   MonitorLocker ml(InitCompleted_lock, Monitor::_no_safepoint_check_flag);
   203   while (!_init_completed) {
   203   while (!_init_completed) {
   206 }
   206 }
   207 
   207 
   208 void set_init_completed() {
   208 void set_init_completed() {
   209   assert(Universe::is_fully_initialized(), "Should have completed initialization");
   209   assert(Universe::is_fully_initialized(), "Should have completed initialization");
   210   MonitorLocker ml(InitCompleted_lock, Monitor::_no_safepoint_check_flag);
   210   MonitorLocker ml(InitCompleted_lock, Monitor::_no_safepoint_check_flag);
   211   OrderAccess::release_store(&_init_completed, true);
   211   Atomic::release_store(&_init_completed, true);
   212   ml.notify_all();
   212   ml.notify_all();
   213 }
   213 }