On Tue, 20 Dec 2022 04:49:46 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> This update just follows the common pattern which was introduced about two >> years ago. At the moment I do not remember the exact reason. This code needs >> to wait for the counter to become zero and to use `ThreadBlockInVM` which >> can reach a safepoint in the destructor. Can we lock with a safepoint check >> in this case? Or we should get rid of the `ThreadBlockInVM` then? >> I'll check if this can be fixed. > > This can be a separate RFE if the reason for it being a nosafepoint lock no > longer holds. It would be cleaner to use a normal safepoint checking lock > than to artificially make the thread safepoint-safe before using it. Agreed. I was thinking about a separate RFE. I started seeing some failures in the S/R related tests with the removed `ThreadBlockInVM` and `_no_safepoint_check_flag`. Need to investigated why. Otherwise, it seems to be working well. ------------- PR: https://git.openjdk.org/jdk/pull/11690