RFR: 8290059: Do not use std::thread in panama tests [v2]

Jorn Vernee jvernee at openjdk.org
Tue Jul 26 13:06:50 UTC 2022


On Fri, 22 Jul 2022 18:37:02 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixes
>
> test/lib/native/testlib_threads.h line 61:
> 
>> 59:     helper->proc(helper->context);
>> 60:     return 0;
>> 61: }
> 
> I'm curious, does this only exist because of the DWORD vs void* return value size of the native thread functions? I wondered why you don't just pass the test procedure to the thread start API directly.
> 
> About stdcall, does Oracle still build Windows 32bit?

Yes, this exists as an adapter from PROCEDURE to whatever callback type the OS API expects. I tried passing the procedure to the start API as well, but the compiler complains that the types don't match. Even if I make PROCEDURE return `int`, it seems to want `DWORD` explicitly.

This was taken from the old library code which uses `_beginthreadex`. That one explicitly wants  to use `__stdcall`, so I just matched that. Looking again, it doesn't look like the same is required for `CreateThread` [1]. I'll remove it for clarity.

[1] : https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms686736(v=vs.85)

-------------

PR: https://git.openjdk.org/jdk/pull/9599



More information about the build-dev mailing list