hotspot/src/share/vm/utilities/workgroup.cpp
changeset 29580 a67a581cfe11
parent 29464 02c245ad3ec9
child 30584 821c80d31b43
equal deleted inserted replaced
29477:82f545c6572b 29580:a67a581cfe11
   122 
   122 
   123 GangWorker* AbstractWorkGang::gang_worker(uint i) const {
   123 GangWorker* AbstractWorkGang::gang_worker(uint i) const {
   124   // Array index bounds checking.
   124   // Array index bounds checking.
   125   GangWorker* result = NULL;
   125   GangWorker* result = NULL;
   126   assert(gang_workers() != NULL, "No workers for indexing");
   126   assert(gang_workers() != NULL, "No workers for indexing");
   127   assert(((i >= 0) && (i < total_workers())), "Worker index out of bounds");
   127   assert(i < total_workers(), "Worker index out of bounds");
   128   result = _gang_workers[i];
   128   result = _gang_workers[i];
   129   assert(result != NULL, "Indexing to null worker");
   129   assert(result != NULL, "Indexing to null worker");
   130   return result;
   130   return result;
   131 }
   131 }
   132 
   132 
   461   _claimed = 0;
   461   _claimed = 0;
   462 #endif
   462 #endif
   463 }
   463 }
   464 
   464 
   465 bool SubTasksDone::is_task_claimed(uint t) {
   465 bool SubTasksDone::is_task_claimed(uint t) {
   466   assert(0 <= t && t < _n_tasks, "bad task id.");
   466   assert(t < _n_tasks, "bad task id.");
   467   uint old = _tasks[t];
   467   uint old = _tasks[t];
   468   if (old == 0) {
   468   if (old == 0) {
   469     old = Atomic::cmpxchg(1, &_tasks[t], 0);
   469     old = Atomic::cmpxchg(1, &_tasks[t], 0);
   470   }
   470   }
   471   assert(_tasks[t] == 1, "What else?");
   471   assert(_tasks[t] == 1, "What else?");