mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8227175: ZGC: ZHeapIterator visits potentially dead objects
Reviewed-by: zgu, eosterlund
This commit is contained in:
parent
24f58a0ac0
commit
02a31bf561
23 changed files with 395 additions and 187 deletions
|
@ -266,6 +266,19 @@ bool ClassLoaderData::ChunkedHandleList::owner_of(oop* oop_handle) {
|
|||
}
|
||||
#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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue