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

Introduce new assertion for checking current thread or handshaker

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 16
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:

      Description

      https://mail.openjdk.java.net/pipermail/serviceability-dev/2020-August/032773.html

      src/hotspot/share/prims/jvmtiEnvThreadState.cpp

        194 #ifdef ASSERT
        195 Thread *current = Thread::current();
        196 #endif
        197 assert(get_thread() == current || current ==
      get_thread()->active_handshaker(),
        198 "frame pop data only accessible from same thread or
      direct handshake");

      Can you factor this out into a separate function so that it is not
      repeated so often. Seems to me that there should be a global function on
      Thread: assert_current_thread_or_handshaker() [yes unpleasant name but
      ...] that will allow us to stop repeating this code fragment across
      numerous files. A follow up RFE for that would be okay too (I see some
      guarantees that should probably just be asserts so they need a bit more
      checking).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ysuenaga Yasumasa Suenaga
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: