hotspot/src/share/vm/utilities/taskqueue.cpp
changeset 6759 67b1a69ef5aa
parent 6251 90e562b9f1cc
child 7397 5b173b4ca846
equal deleted inserted replaced
6451:516540f1f076 6759:67b1a69ef5aa
   142   os::sleep(Thread::current(), millis, false);
   142   os::sleep(Thread::current(), millis, false);
   143 }
   143 }
   144 
   144 
   145 bool
   145 bool
   146 ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
   146 ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
       
   147   assert(_n_threads > 0, "Initialization is incorrect");
   147   assert(_offered_termination < _n_threads, "Invariant");
   148   assert(_offered_termination < _n_threads, "Invariant");
   148   Atomic::inc(&_offered_termination);
   149   Atomic::inc(&_offered_termination);
   149 
   150 
   150   uint yield_count = 0;
   151   uint yield_count = 0;
   151   // Number of hard spin loops done since last yield
   152   // Number of hard spin loops done since last yield
   253 bool ObjArrayTask::is_valid() const {
   254 bool ObjArrayTask::is_valid() const {
   254   return _obj != NULL && _obj->is_objArray() && _index > 0 &&
   255   return _obj != NULL && _obj->is_objArray() && _index > 0 &&
   255     _index < objArrayOop(_obj)->length();
   256     _index < objArrayOop(_obj)->length();
   256 }
   257 }
   257 #endif // ASSERT
   258 #endif // ASSERT
       
   259 
       
   260 void ParallelTaskTerminator::reset_for_reuse(int n_threads) {
       
   261   reset_for_reuse();
       
   262   _n_threads = n_threads;
       
   263 }
       
   264