RFR: 8252794: Creation of JNIMethodBlock should be done with a leaf lock [v2]
Robbin Ehn
rehn at openjdk.java.net
Wed Sep 9 07:33:08 UTC 2020
On Wed, 9 Sep 2020 01:15:26 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Corrected comment
>
> src/hotspot/share/oops/method.cpp line 2190:
>
>> 2188: // Also have to add the method to the list safely, which the cld lock
>> 2189: // protects as well.
>> 2190: MutexLocker ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
>
> The comment above this states:
> // Also have to add the method to the list safely, which the cld lock
> // protects as well.
> I don't know what list is being referred to here but either the comment is incorrect or else the change of lock is
> incorrect!
We create the list with:
`cld->set_jmethod_ids(new JNIMethodBlock(capacity));`
And add to the list:
`return (jmethodID)cld->jmethod_ids()->add_method(m);`
I removed 'cld' from comment.
> src/hotspot/share/oops/method.cpp line 2214:
>
>> 2212: // Also have to add the method to the list safely, which the cld lock
>> 2213: // protects as well.
>> 2214: MutexLocker ml(JmethodIdCreation_lock, Mutex::_no_safepoint_check_flag);
>
> Ditto
Ditto fix
-------------
PR: https://git.openjdk.java.net/jdk/pull/53
More information about the hotspot-dev
mailing list