diff -r 73395f9cad54 -r 3868dde58ebb src/hotspot/share/classfile/classLoaderData.cpp --- a/src/hotspot/share/classfile/classLoaderData.cpp Tue Jul 02 12:24:26 2019 +0200 +++ b/src/hotspot/share/classfile/classLoaderData.cpp Mon Jun 10 13:04:12 2019 +0200 @@ -266,6 +266,19 @@ } #endif // PRODUCT +void ClassLoaderData::clear_claim(int claim) { + for (;;) { + int old_claim = Atomic::load(&_claim); + if ((old_claim & claim) == 0) { + return; + } + int new_claim = old_claim & ~claim; + if (Atomic::cmpxchg(new_claim, &_claim, old_claim) == old_claim) { + return; + } + } +} + bool ClassLoaderData::try_claim(int claim) { for (;;) { int old_claim = Atomic::load(&_claim);