RFR: 8353950: Clipboard interaction on Windows is unstable [v6]
Matthias Bläsing
mblaesing at openjdk.org
Wed Jun 4 17:18:01 UTC 2025
On Wed, 4 Jun 2025 17:14:15 GMT, Matthias Bläsing <mblaesing at openjdk.org> wrote:
>> - Introduce a lock into WClipboard that protects the code between
>> openClipboard/closeClipboard invocations.
>> The native side does not allow to open the clipboard multiple
>> times or share the opened clipboard between multiple threads.
>>
>> - Remove of need to call openClipboard/closeClipboard from
>> getClipboardFormats by using the win32 call
>> GetUpdatedClipboardFormats
>>
>> - Prevent a race-condition by not registering the connection
>> between java and native side of clipboard multiple time, but
>> just at construction time.
>
> Matthias Bläsing has updated the pull request incrementally with one additional commit since the last revision:
>
> Limit running test only on windows
@kumarabhi006 my thinking was, that the JVM should not crash on any platform when clipboard is accessed concurrently, but you are right, that the crash is observed windows only. Only that platform (see implementation class `WClipboard`) requires the `openClipboard`, `closeClipboard` calls. For all other platforms these calls are no-ops.
Pushed an update adding the test requirement to the test.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24614#issuecomment-2940800471
More information about the client-libs-dev
mailing list