mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8221967: InternTest.java timed out
Move redundant table lookup and make rehashing be a needed guaranteed safepoint cleanup action. Reviewed-by: dholmes, rehn
This commit is contained in:
parent
b08841af0d
commit
e47584d00d
3 changed files with 16 additions and 8 deletions
|
@ -481,14 +481,17 @@ Symbol* SymbolTable::do_add_if_needed(const char* name, int len, uintx hash, boo
|
|||
Thread* THREAD = Thread::current();
|
||||
|
||||
do {
|
||||
if (_local_table->get(THREAD, lookup, stg, &rehash_warning)) {
|
||||
sym = stg.get_res_sym();
|
||||
break;
|
||||
}
|
||||
// Callers have looked up the symbol once, insert the symbol.
|
||||
sym = allocate_symbol(name, len, heap);
|
||||
if (_local_table->insert(THREAD, lookup, sym, &rehash_warning, &clean_hint)) {
|
||||
break;
|
||||
}
|
||||
// In case another thread did a concurrent add, return value already in the table.
|
||||
// This could fail if the symbol got deleted concurrently, so loop back until success.
|
||||
if (_local_table->get(THREAD, lookup, stg, &rehash_warning)) {
|
||||
sym = stg.get_res_sym();
|
||||
break;
|
||||
}
|
||||
} while(true);
|
||||
|
||||
update_needs_rehash(rehash_warning);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue