On Thu, 11 Aug 2022 12:38:50 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> Please review this fix for a problem discovered by @stuart-marks in the >> course of examining the VM shutdown behaviour. The VM code assumed that only >> unattached threads called JNI's DestroyJavaVM and so they were always >> attached as non-daemon threads. But it is perfectly valid to call >> DestroyJavaVM from an already attached thread, which could be a daemon. The >> fix simply checks whether the caller is a daemon or not and adjusts the >> expected count of active threads to see. There is also an adjustment to the >> thread termination logic to also notify at the right time. >> >> Thanks to @stuart-marks for the reproducer in JBS - the longest part of this >> by many hours was converting the test over the jtreg. :) >> >> Testing: >> - the new test on all core platforms >> - tiers 1-3 >> Thanks. > > David Holmes has updated the pull request incrementally with one additional > commit since the last revision: > > Suggestion from Thomas Still good. ------------- Marked as reviewed by stuefe (Reviewer). PR: https://git.openjdk.org/jdk/pull/9803