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

SuspendibleThreadSet::_suspend_all should be volatile/atomic

XMLWordPrintable

    • gc
    • b29

        SuspendibleThreadSet::should_yield() just returns the value of the _suspend_all flag, which is a simple static variable. That variable is set under a lock, but possibly read concurrently by other threads without any locking.

        [For considerations of backporting] This is *probably* effectively harmless, as any loops involving should_yield checks probably won't have the check hoisted out of the loop due to sufficiently opaque loop bodies.

              tschatzl Thomas Schatzl
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: