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

replace _is_disable_suspend in JavaThread with an atomic counter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • None

      Below is a review comment (see JDK-8311218) from Alan:

      src/hotspot/share/runtime/javaThread.hpp line 652:
      > 651: bool is_disable_suspend() const { return _is_disable_suspend; }
      > 652: void toggle_is_disable_suspend() { _is_disable_suspend = !_is_disable_suspend; };

      Looking at this again then I don't think it can be a bit that is toggled on and off will work. Consider the case where several threads attempt to poll the state of a virtual Thread with Thread::getState at the same time. This can't work without an atomic counter and further coordination. So I think further work is required on this issue.

            sspitsyn Serguei Spitsyn
            sspitsyn Serguei Spitsyn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: