Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8278923

Document Klass::is_loader_alive

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 19
    • hotspot
    • b06

      It's not clear what "loader" means in the API Klass::is_loader_alive(). At first look, it would mean:

         is the oop Klass::class_loader() alive?

      but it actually means

         is the oop Klass::klass_holder() alive?

      In most cases, these two have the same meaning. However, that's not true for non-STRONG hidden classes, where Klass::is_loader_alive() means only the latter.

      Perhaps we should rename it to is_holder_alive to avoid the ambiguity.

      We should add docs to describe:

      + What's the exact meaning of this function

      + What does a return value of false mean for the Klass

         I think it means that the Klass is unloaded, or about to be unloaded

      + How to avoid race conditions when calling this function

         The return value of this function may change from true to false in a safepoint. So the caller of this function must ensure that a safepoint doesn't happen when interpreting the return value

            coleenp Coleen Phillimore
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: