RFR: 8290059: Do not use std::thread in panama tests [v2]
David Holmes
dholmes at openjdk.org
Sat Jul 23 06:02:14 UTC 2022
On Fri, 22 Jul 2022 16:45:55 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> This patch removes the use of std::thread from the `java.lang.foreign` tests, and switches to the OS specific thread APIs, in order to change things such as the stack size on some platforms where this is required in the future (see the JBS issue).
>>
>> This is done by adding a small header-only library that exposes a function to run code in freshly spawned threads (`run_async`).
>>
>> Testing: Running the affected tests on platforms that implement the linker.
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>
> Fixes
`run_async` is an odd name for this, especially as the fact you create then join mean it doesn't run asynchronously at all - it runs synchronously in another thread. The API would be more generally useful if you split the start and the join, but that would require also exposing an opaque thread "handle" (though splitting also means you don't have to try and think of a good name for `run_in_a_new_thread-and_join_it()` - you just have `threadStart` and `threadJoin`).
-------------
PR: https://git.openjdk.org/jdk/pull/9599
More information about the build-dev
mailing list