Skip to content

Commit

Permalink
Avoid race condition between compiler thread generating exception blob
Browse files Browse the repository at this point in the history
and main thread generating adapters

Signed-off-by: Ashutosh Mehra <asmehra@redhat.com>
  • Loading branch information
ashu-mehra committed Jan 10, 2025
1 parent 2c1c65c commit 28419f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hotspot/share/code/SCCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2489,6 +2489,8 @@ bool SCCache::store_exception_blob(CodeBuffer* buffer, int pc_offset) {
buffer->decode();
}
#endif
// we need to take a lock to prevent race between compiler thread generating blob and the main thread generating adapter
MutexLocker ml(Compile_lock);
if (!cache->align_write()) {
return false;
}
Expand Down

0 comments on commit 28419f4

Please sign in to comment.