JDK-8274282 : Clarify special wait assert
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 18
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2021-09-24
  • Updated: 2021-09-24
Description
In check_rank, there's an assert that you can't wait while you're holding a lock with rank below "special", which I changed to "nosafepoint".  Now we check mutex rankings in wait, where we didn't before, so there's no reason for this assert.

@@ -384,14 +384,11 @@ void Mutex::check_rank(Thread* thread) {
  if (owned_by_self()) {
    // wait() case
    Mutex* least = get_least_ranked_lock_besides_this(locks_owned);
    // We enforce not holding locks of rank nosafepoint or lower while waiting.
    // Also "this" should be the monitor with lowest rank owned by this thread.
    if (least != NULL && (least->rank() <= nosafepoint || least->rank() <= this->rank())) {
    // "this" should be the monitor with lowest rank owned by this thread.
    if (least != NULL && least->rank() <= this->rank()) {