src/hotspot/share/classfile/classLoaderData.cpp
changeset 55603 3868dde58ebb
parent 54847 59ea39bb2809
child 58063 bdf136b8ae0e
child 58177 4932dce35882
--- 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);