replace _is_disable_suspend in JavaThread with an atomic counter

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: