src/hotspot/share/classfile/classLoaderData.cpp
changeset 55603 3868dde58ebb
parent 54847 59ea39bb2809
child 58063 bdf136b8ae0e
child 58177 4932dce35882
equal deleted inserted replaced
55602:73395f9cad54 55603:3868dde58ebb
   264   }
   264   }
   265   return false;
   265   return false;
   266 }
   266 }
   267 #endif // PRODUCT
   267 #endif // PRODUCT
   268 
   268 
       
   269 void ClassLoaderData::clear_claim(int claim) {
       
   270   for (;;) {
       
   271     int old_claim = Atomic::load(&_claim);
       
   272     if ((old_claim & claim) == 0) {
       
   273       return;
       
   274     }
       
   275     int new_claim = old_claim & ~claim;
       
   276     if (Atomic::cmpxchg(new_claim, &_claim, old_claim) == old_claim) {
       
   277       return;
       
   278     }
       
   279   }
       
   280 }
       
   281 
   269 bool ClassLoaderData::try_claim(int claim) {
   282 bool ClassLoaderData::try_claim(int claim) {
   270   for (;;) {
   283   for (;;) {
   271     int old_claim = Atomic::load(&_claim);
   284     int old_claim = Atomic::load(&_claim);
   272     if ((old_claim & claim) == claim) {
   285     if ((old_claim & claim) == claim) {
   273       return false;
   286       return false;