Skip to content

Commit

Permalink
8311981: Test gc/stringdedup/TestStringDeduplicationAgeThreshold.java…
Browse files Browse the repository at this point in the history
…#ZGenerational timed out

Reviewed-by: stefank, pchilanomate, dcubed, rehn
  • Loading branch information
David Holmes committed Aug 14, 2023
1 parent 595fdd3 commit f142470
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/hotspot/share/runtime/handshake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,17 @@ HandshakeOperation* HandshakeState::get_op_for_self(bool allow_suspend, bool che
}

bool HandshakeState::has_operation(bool allow_suspend, bool check_async_exception) {
MutexLocker ml(&_lock, Mutex::_no_safepoint_check_flag);
return get_op_for_self(allow_suspend, check_async_exception) != nullptr;
// We must not block here as that could lead to deadlocks if we already hold an
// "external" mutex. If the try_lock fails then we assume that there is an operation
// and force the caller to check more carefully in a safer context. If we can't get
// the lock it means another thread is trying to handshake with us, so it can't
// happen during thread termination and destruction.
bool ret = true;
if (_lock.try_lock()) {
ret = get_op_for_self(allow_suspend, check_async_exception) != nullptr;
_lock.unlock();
}
return ret;
}

bool HandshakeState::has_async_exception_operation() {
Expand Down

3 comments on commit f142470

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dholmes-ora
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u

@openjdk
Copy link

@openjdk openjdk bot commented on f142470 Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dholmes-ora the backport was successfully created on the branch dholmes-ora-backport-f142470d in my personal fork of openjdk/jdk21u. To create a pull request with this backport targeting openjdk/jdk21u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit f142470d from the openjdk/jdk repository.

The commit being backported was authored by David Holmes on 14 Aug 2023 and was reviewed by Stefan Karlsson, Patricio Chilano Mateo, Daniel D. Daugherty and Robbin Ehn.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u:

$ git fetch https://github.com/openjdk-bots/jdk21u.git dholmes-ora-backport-f142470d:dholmes-ora-backport-f142470d
$ git checkout dholmes-ora-backport-f142470d
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u.git dholmes-ora-backport-f142470d

Please sign in to comment.