RFR: 8256383: PlatformMutex::try_lock has different semantics on Windows and Posix
David Holmes
david.holmes at oracle.com
Tue Nov 17 13:16:27 UTC 2020
On 17/11/2020 11:10 pm, Stefan Karlsson wrote:
> On Tue, 17 Nov 2020 05:41:44 GMT, David Holmes <dholmes at openjdk.org> wrote:
>
>> Mutex::try_lock has to allow for the possibility that the PlatformMutex::try_lock allows recursive locking.
>>
>> Added additional commentary on the semantics provided by Mutex and the PlatformMutex classes.
>>
>> Testing: GHA, mach5 tiers 1-3
>
> @dholmes-ora It makes difference w.r.t. atomicity. You can argue that this isn't important in this specific use-case, but I thought there was an agreement among HotSpot devs to use Atomic::load for racy access. Esp. now that we've moved to C++11 and racy loads are considered undefined behavior. John created JDK-8234192 when this was discussed earlier.
As I said I'm happy to file a RFE to change all the code to do this, but
it seems rather pointless to do this one occurrence in this PR.
David
-----
> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/1247
>
More information about the hotspot-runtime-dev
mailing list