src/hotspot/share/gc/shared/parallelCleaning.cpp
changeset 59252 623722a6aeb9
parent 57510 4db4d0d14390
child 59290 97d13893ec3c
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
    92         claimed_nmethods[i] = last.method();
    92         claimed_nmethods[i] = last.method();
    93         (*num_claimed_nmethods)++;
    93         (*num_claimed_nmethods)++;
    94       }
    94       }
    95     }
    95     }
    96 
    96 
    97   } while (Atomic::cmpxchg(last.method(), &_claimed_nmethod, first) != first);
    97   } while (Atomic::cmpxchg(&_claimed_nmethod, first, last.method()) != first);
    98 }
    98 }
    99 
    99 
   100 void CodeCacheUnloadingTask::work(uint worker_id) {
   100 void CodeCacheUnloadingTask::work(uint worker_id) {
   101   // The first nmethods is claimed by the first worker.
   101   // The first nmethods is claimed by the first worker.
   102   if (worker_id == 0 && _first_nmethod != NULL) {
   102   if (worker_id == 0 && _first_nmethod != NULL) {
   128 bool KlassCleaningTask::claim_clean_klass_tree_task() {
   128 bool KlassCleaningTask::claim_clean_klass_tree_task() {
   129   if (_clean_klass_tree_claimed) {
   129   if (_clean_klass_tree_claimed) {
   130     return false;
   130     return false;
   131   }
   131   }
   132 
   132 
   133   return Atomic::cmpxchg(1, &_clean_klass_tree_claimed, 0) == 0;
   133   return Atomic::cmpxchg(&_clean_klass_tree_claimed, 0, 1) == 0;
   134 }
   134 }
   135 
   135 
   136 InstanceKlass* KlassCleaningTask::claim_next_klass() {
   136 InstanceKlass* KlassCleaningTask::claim_next_klass() {
   137   Klass* klass;
   137   Klass* klass;
   138   do {
   138   do {