On Fri, 22 Jul 2022 16:45:55 GMT, Jorn Vernee <jver...@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

Reply via email to